From 7b023112f1ee0400358bd2b8a85e849180254c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 23 Oct 2018 06:01:26 -0400 Subject: [PATCH] Print header section only if there is no title paragraph --- .../templates/layout/layout--onecol--node.html.twig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/agaric/templates/layout/layout--onecol--node.html.twig b/agaric/templates/layout/layout--onecol--node.html.twig index 7d9ab83..13fa121 100644 --- a/agaric/templates/layout/layout--onecol--node.html.twig +++ b/agaric/templates/layout/layout--onecol--node.html.twig @@ -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 %} {# Header hero region #}
@@ -30,6 +40,7 @@
+{% endif %} {{ content.content }}