Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be fantastic if we could change our sidebar widths with through a sub-theme's admin interface.
Comment | File | Size | Author |
---|---|---|---|
#32 | #2128129-fluid-container-working.png | 57.78 KB | nithinkolekar |
#32 | #2128129-fluid-container-not-working.png | 66 KB | nithinkolekar |
#30 | provide_setting_to-2128129-30.patch | 32.21 KB | markhalliwell |
Comments
Comment #1
zilla CreditAttribution: zilla commentedthat would be very interesting - like a view of possible layouts (one sidebar, no sidebars, two sidebars) and then a simple text entry for something at that layout level like span4 for left column, span8 for main content (etc), or maybe additional for maxwidth and so on
Comment #2
mattsmith3 CreditAttribution: mattsmith3 commentedTo start, it could be as easy as 3 dropdowns with 1-12 as column values, for the left, content, and right regions. A quick check to make sure they add up to 12, and we're on the way.
Comment #3
netikseo CreditAttribution: netikseo commentedI also think it would be very useful...
Comment #4
joep.hendrix CreditAttribution: joep.hendrix commented+1
Currently we have set in code the nr of spans per sidebar en the preprocess_page will generate the classes accordingly.
Comment #5
tkruger CreditAttribution: tkruger commentedI would like to see this feature as well. I need first_sidebar to be 4 column and if the sidebar is present have the middle content be corrected.
Comment #6
markhalliwellComment #8
markhalliwellThis feature is quite extensive and adds the necessary settings to create "dynamic regions". Please test that this indeed functions correctly (desired).
NOTE: While coding this feature, I realized that there has been extraneous markup surrounding regions. Several new
region--*.tpl.php
files have been added (navigation, header, content, sidebars, footer) and their subsequentpage.tpl.php
code moved into these. You will likely need to convert existing sub-themes to this new architecture.Comment #9
Christopher Riley CreditAttribution: Christopher Riley commentedI am curious as to why you decided that we need to have the menus rolled into $variables['page']['navigation'] as I am afraid that it is going to cause some people grief on customization.
Comment #10
markhalliwell$navbar_classes
.TBH, I'm not entirely "thrilled" with this approach and agree that throwing this in there is probably not the best idea. I was just trying to commit something while not actually breaking it either. The "primary and secondary navs" are actually legacy code. Do we want to spend the time and refactoring it? Should we try and tackle #1893532: [bootstrap][policy][7.x-3.x] Navigation/Menus before hand?
This is really just the first pass at making this feature a reality (and what makes the most sense ATM). I certainly welcome ideas, thoughts and suggestions, which I should have stated before when asking to test.
Comment #11
bkno CreditAttribution: bkno commentedUpdated my subtheme to use the new approach, works great - thanks!
Comment #13
markhalliwellOk, I moved it back into the page variables (like it was before). I just had to extend the if statement to include other things than just "$content" so it'd print the region.... missed that last go around.
Comment #15
markhalliwellRegions suggestions now include "front" and entity specificity (if the menu object is an entity):
Comment #17
TheJoker CreditAttribution: TheJoker commentedThis is how it could be due to the fact that my own regions in the subtopic not disappear at variable:
if (!empty($page['line']) || !empty($page['content_last'])):
???
They are only on the front page, but regions are displayed even if there are no other pages, respectively, they display a blank code without content. I'm confused.
Comment #19
markhalliwellIt has become increasingly obvious that this needs to either be rolled back (and wait for BS4, aka: major version bump: 7.x-4.x) or figure out a better solution that doesn't break backwards compatibility. Any suggestions?
Comment #21
markhalliwellHere is the reverted changes as a patch. We cannot, for obvious backward compatibility/update reasons, add this into the 7.x-3.1 release as it stands now. If someone wants to try and take a stab at this so it doesn't drastically alter the page and region templates, please go for it. That being said, I do think this is the right approach, we may just have to wait for BS4 (aka 7.x-4.x).
Comment #22
markhalliwellI have unpublished the change record (to be a draft). I also placed a note at the top explaining that this is currently experimental code and that users should see this issue for further details.
Comment #23
markhalliwellMore back history for why this has been reverted.
Comment #24
Robytfc CreditAttribution: Robytfc commentedCould this be something added in 8.x? if so, would there be interest in a patch?
Comment #26
markhalliwell@neardark and I discussed this at length in #drupal-bootstrap.
Because of the nature of this issue and the amount of code it changes, it is impossible to successfully commit this patch for BS3 (7/8.x-3.x) due to backwards compatibility issues mentioned above and how it may impact over nearly 50k installs.
This feature is definitely on the books to make it into BS4 (7/8.x-4.x). If one needs this support for the 3.x branches, the above patch does work (I use it myself on a couple projects), but it is too big of a paradigm shift in how pages and regions are constructed to introduce into a stable 7/8.x-3.x release.
As far as a release date for 7/8.x-4.x, that remains to be determined. No version of BS4 (alpha or beta) has yet been released. Once one does, I imagine this will become more of our focus and we can pick this issue back up.
Comment #27
markhalliwell@Robytfc, I didn't answer your question entirely though. Yes, a patch for 8.x would certainly be welcomed. It won't be committed until BS4 is a reality though. So if one for 8.x-3.x is needed, it will only ever live here.
Comment #29
markhalliwellChanging to proper branch version for #2554199: Bootstrap 4.
Comment #30
markhalliwellHere's a rerolled patch against the latest 7.x-3.x branch (for 7.x-3.0-beta1 installs, so they can "upgrade").
Comment #31
nithinkolekar CreditAttribution: nithinkolekar commentedreview
1- small typo in templates/system/region--header.tpl.php
<?php if ($content): ?>\
2- Notice: Undefined variable: regions in line 134 of theme-settings.php which makes Region column size and Dynamic regions form not rendering in theme settings page.
3- enabling Fluid container doesn't work anymore for navbar i.e menu is rendering in 12 column fixed size.
Comment #32
nithinkolekar CreditAttribution: nithinkolekar commentedafter correcting (2) theme settings are rendering properly, but I do not get how this "Region column size" works.
Suppose if we set 3 column setting to 2 column will that change "Side first" or any other region having 3 columns to 2 columns?
navbar screens
working before
not working with patch applied
Comment #33
nithinkolekar CreditAttribution: nithinkolekar commented@markcarver
any reason id="navbar-collapse" is removed from bootstrap/templates/system/region--navigation.tpl.php?
Nav menu is not expanding in mobile device without that id.(got hint from #2277725-3: Dropdown menu is not expanding on mobiles with bootstrap 3 theme)
Comment #34
shelaneThis theme will not be supported for Bootstrap 4. See alternative themes for this support.