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.
I don't know if my issue is related to https://www.drupal.org/node/2359087, but if all panes inside a region are empty (and not printed out) the wrapper is still printed out (eg. #panel-bootstrap-region-top).
Sure we probably can use the :empty CSS selector.. but printing out an empty region wrapper does not make much sense to me.
If its technicly nessecery to print out the surrounding wrappers (row, columns), we should give them some kinda "region-empty" class or something?
Update: The :empty selector won't work, because there are some spaces inside the wrapper.
Comment | File | Size | Author |
---|---|---|---|
#7 | panels_bootstrap_layout_builder_prevent_empty_wrappers-2889629-7.patch | 1.59 KB | Anybody |
Comments
Comment #2
thomas.frobieterComment #3
thomas.frobieterComment #4
AnybodyYes, that makes a lot of sense. Here's the patch, tested successfully. Please provide some feedback for RTBC.
Comment #5
AnybodySorry there seems to have been a problem with the patch. My IDE seems to have cleaned all whitespaces etc. but didn't include the real change ... -.- sorry :D
Correct patch attached.
Comment #6
AnybodyComment #7
AnybodyFinally. My IDE was driving me crazy... this is the right one and only contains the required changes.
Comment #8
lesleyfernandes CreditAttribution: lesleyfernandes commentedPatch #7 has worked for me.
Do you have any plans to review and commit it?
Comment #9
NWOM CreditAttribution: NWOM commented#7 works great and can be applied without problems to the newest dev. Thank you.
Comment #10
hargobindThis works great in my testing. Empty columns/regions are not printed.
Comment #11
hargobindOn further thought, I think it's important to make this option configurable.
Given that layouts are often grids with a defined structure, site builders may actually not expect columns to simply disappear if the content is empty.
For instance, if I have a custom block or panels pane that occasionally displays empty content (e.g. "Today's news"), I wouldn't necessarily want that block disappearing since it could cause columns after the empty region to slide over -- and even entire rows could slide up.
I'm switching this to Needs Work until there is a configurable option. Otherwise, we run the risk of frustrating site builders by introducing unexpected behavior.