[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] theme: Improve fixed width operation
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <69b845f6fcb2_3b18c860-235@gitlab-sidekiq-low-urgency-cpu-bound-v2-69484575d6-xhh9j.mail> |
Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
4349abd0 by Jonny Bradley at 2026-03-16T17:55:56+00:00
[FIX] theme: Improve fixed width operation
---
* [FIX] theme: Improve fixed width operation
---
* [MOD] theme: Change the default for pref `layout_fixed_width` to be empty to allow the standard Bootstrap responsive container widths to work
* [FIX] theme: Make the top zone `header` container inthe social layout observe the `feature_fixed_width` pref (thanks for the moral support @gary.cunningham-lee ;)
See merge request tikiwiki/tiki!9743
(cherry picked from commit 3cb2090b5e7a965495f7f20ed5919890f8000a39 with manual assistance - couldn't get it to work in 29.x)
See merge request tikiwiki/tiki!9762
- - - - -
4 changed files:
- + installer/schema/20260312_change_fixed_width_default_tiki.php
- lib/prefs/layout.php
- lib/setup/theme.php
- templates/layouts/social/layout_view.tpl
Changes:
=====================================
installer/schema/20260312_change_fixed_width_default_tiki.php
=====================================
@@ -0,0 +1,22 @@
+<?php
+
+// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
+//
+// All Rights Reserved. See copyright.txt for details and a complete list of authors.
+// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
+use Tiki\Installer\Installer;
+
+/**
+ * Set the default value on upgraded Tikis for theme_unified_admin_backend to 'n'
+ *
+ * @param Installer $installer
+ */
+function upgrade_20260312_change_fixed_width_default_tiki($installer)
+{
+ global $prefs;
+
+ if ($prefs['feature_fixed_width'] === 'y') {
+ // keep the default for upgrades if in use
+ $installer->preservePreferenceDefault('layout_fixed_width', '1170px');
+ }
+}
=====================================
lib/prefs/layout.php
=====================================
@@ -11,12 +11,12 @@ function prefs_layout_list()
'name' => tra('Layout width'),
'description' => tra('The width of the site\'s content area (Bootstrap container div), centered in the browser window.'),
'type' => 'text',
- 'hint' => tra('The default is 1170px.'),
+ 'hint' => tra('The default is to use the Bootstrap responsive default.'),
'dependencies' => [
'feature_fixed_width',
],
'tags' => ['basic'],
- 'default' => '1170px',
+ 'default' => '',
],
'layout_tabs_optional' => [
'name' => tra('Tabs optional'),
=====================================
lib/setup/theme.php
=====================================
@@ -44,11 +44,9 @@ $headerlib->add_js_module('
');
$headerlib->add_jsfile(NODE_PUBLIC_DIST_PATH . '/clipboard/dist/clipboard.min.js');
-if ($prefs['feature_fixed_width'] === 'y') {
+if ($prefs['feature_fixed_width'] === 'y' && ! empty($prefs['layout_fixed_width'])) {
$headerlib->add_css(
- '@media (min-width: 1200px) { .container { max-width:' .
- (! empty($prefs['layout_fixed_width']) ? $prefs['layout_fixed_width'] : '1170px') .
- '; } }'
+ "@media (min-width: 1200px) { .container { max-width:{$prefs['layout_fixed_width']}; } }"
);
}
=====================================
templates/layouts/social/layout_view.tpl
=====================================
@@ -187,7 +187,7 @@
</footer>
{if $prefs.theme_unified_admin_backend neq 'y' or $smarty.server.SCRIPT_NAME|strpos:'tiki-admin.php' === false}
<header class="navbar navbar-expand-md tiki-top-nav-{$navbar_color_variant} navbar-{$navbar_color_variant} bg-{$navbar_color_variant} fixed-top">
- <div class="container-fluid">
+ <div class="container{if $prefs.feature_fixed_width neq 'y'}-fluid{/if}">
{modulelist zone=top class="top_modules w-100 tiki-top-nav-{$navbar_color_variant} navbar-{$navbar_color_variant}-parent bg-{$navbar_color_variant}-parent" heading_text='{tr}Site identity, navigation, etc.{/tr}' role=banner}
</div>
</header>
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4349abd01e912228cd239db7b9b0ff71f6609381
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4349abd01e912228cd239db7b9b0ff71f6609381
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs