Score:0

Strange behaviour of regions displays in D9 Bootstrap theme

jp flag

I'm working on a site based on Drupal 9 and Bootstrap 5. I can normally create new regions and call them in the front.html.twig template, so that they are correctly displayed and rendered in the block-layouts-list.

When I try to override a region with its own template, renaming it region--NAME.html.twig and calling it with {{ page.NAME }} in the html.twig template, its content doesn't show up.

After assigning an existing block to this region (for example "powered by drupal" or the "tags"-block), then the override region--NAME.html.twig is showing as wanted, without the assigned block being visible...

That behaviour I have experienced with two different template overrides.

Am I doing something wrong or is this a bug?

ru flag
Regions do not at all render if they are completely empty in block layout. This behavior is intented, similar strategies are all over Drupal (e.g. if a node field is empty, the field template and any wrapper HTML will not be rendered too). If the block isn't showing... did you include the `{{ content }}` in your Twig template? Is the block's visiblity permission restricted?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.