8 – Problem of hiding regions when blocks are empty

Have a hard time seeing why my regions are going so that I think they should not …


{% if page.region%}
{{}} Page.region
{% end if %}


{% so happy%}
{% end if %}


{% so happy%}

  {# Label. If it is not displayed, we still provide it to the screen readers. #}
{% otherwise configuration.label_display%}
{% set title_attributes = title_attributes.addClass (& quot; Visually Hidden & # 39;)%}
{% end if %}
{{}} Title_prefix
  {{}} Configuration.label
  {{}} Title_suffix

{% block content%} {{content}} {% endblock%}
{% end if %}

block – messages-system-block.html.twig:

{% extend "block.html.twig"%}

{% block content%}
{% endblock%}

I think this has to do with my extended block models. These seem to be those that will continue to be made even if there is no content.

What do I miss? If I use a if check around {% block content%} Twig throws an exception, inside there is no effect.

Add | render | striptags | trim | length> 0 in none of these models does the problem seem to be solved, and in some cases Drupal forms and messages are not validated (so nothing comes back when it should).