I'm using bootstrap layouts with panels and page manager.
1. I have visibility rules applied to some panes.
2. On pages related to the panel i have empty layout regions showing up.
3. Is there anyway to add hide if empty on each layout region?
See attached image of html where the layout pane is empty.
thanks! Any help is appreciated!!
| Comment | File | Size | Author |
|---|---|---|---|
| Capture-1.JPG | 45.08 KB | webdesgnr14 |
Comments
Comment #2
webdesgnr14 commentedAnyone!!!
Comment #3
Pradnya Pingat commentedHi ,
can you help me in which twig file you are finding this issue or on which page. I am unable to reproduce
Comment #4
Pradnya Pingat commentedyou can hide empty regions in twig by using the render argument with {% if region_name|render %} {%- endif -%}
Comment #5
kay_v commentedI can confirm the same situation occurs with Display Suite, but have not had a chance to dig into it further (I plan to return to this question in a few weeks, once a few other concerns are cleared away).
To reproduce:
Drupal-8.5.3
Bootstrap_Layouts-8.x-5.1
Display_Suite-8.x-3.1
Bootstrap_8.x-3.11
With Bootstrap as default theme using all defaults (CDN is jsDelivr-3.3.7)
On the Article content type, select a 2-column stacked layout
Place fields in layout:
- title in top
- description in left
- comment in right
Create an article with a title and no description. On save, comment form appears in right column with nothing in left column. Left column classes:
col-sm-6 bs-region bs-region--leftSafe to assume the template is
bootstrap_layouts/templates/3.0.0/bs-2col-stacked.html.twig?I'll turn on debug in a future pass and add more specifics.
Comment #6
harings_rob commentedI don't think there is many things that can be done from the side of this module.
For a custom layout I use
{% if content.REGION|render is not empty %}Suboptimal, but Drupal sends empty render arrays to twig. (I think)