[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] theme: Improve fixed width operation

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69b2ff4f34f78_3b18a3a87755d@gitlab-sidekiq-low-urgency-cpu-bound-v2-6c96689c6b-kkmtz.mail>

Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
3cb2090b by Jonny Bradley at 2026-03-12T17:51:01+00:00
[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

- - - - -


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
=====================================
@@ -42,11 +42,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
=====================================
@@ -37,7 +37,7 @@
         {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} tiki-header-top fixed-top p-0">
-                <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/3cb2090b5e7a965495f7f20ed5919890f8000a39

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/3cb2090b5e7a965495f7f20ed5919890f8000a39
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.