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!!

CommentFileSizeAuthor
Capture-1.JPG45.08 KBwebdesgnr14

Comments

webdesgnr14 created an issue.

webdesgnr14’s picture

Anyone!!!

Pradnya Pingat’s picture

Hi ,
can you help me in which twig file you are finding this issue or on which page. I am unable to reproduce

Pradnya Pingat’s picture

you can hide empty regions in twig by using the render argument with {% if region_name|render %} {%- endif -%}

kay_v’s picture

I 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--left

Safe 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.

harings_rob’s picture

I 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)