Print header section only if there is no title paragraph

This commit is contained in:
benjamin melançon 2018-10-23 06:01:26 -04:00
parent 54f51b569b
commit 7b023112f1

View file

@ -22,6 +22,16 @@
{# expected if statement would start here #}
{% set classes = classes|merge(['is-dark']) %}
{% set has_title_paragraph = false %}
{% if content.field_body_paragraph %}
{% for paragraph in content.field_body_paragraph['#items'] %}
{% if paragraph.entity.type.0.entity.id == 'title' %}
{% set has_title_paragraph = true %}
{% endif %}
{% endfor %}
{% endif %}
{% if not has_title_paragraph %}
<section{{ attributes.addClass(classes) }}>
{# Header hero region #}
<div class="container">
@ -30,6 +40,7 @@
</div>
</div>
</section>
{% endif %}
{{ content.content }}