From ed32e0afd2b15feec15e83f9f6cd64d17ed906cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Sat, 3 Nov 2018 10:22:13 -0400 Subject: [PATCH] Print special header for front page even if front page is a node --- agaric/templates/layout/page.html.twig | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/agaric/templates/layout/page.html.twig b/agaric/templates/layout/page.html.twig index 7de591e..98f99a1 100644 --- a/agaric/templates/layout/page.html.twig +++ b/agaric/templates/layout/page.html.twig @@ -35,25 +35,21 @@ {% endif %} {% endblock navbar %} -{% set header_section_attributes = create_attribute({'class': ['hero', 'is-dark']}) %} +{% set header_section_attributes = create_attribute() %} {% if is_front %} {# TODO set a variable for background image so we can use base_path rather than / #} - {% set header_section_attributes = header_section_attributes.addClass('hero-main is-large').setAttribute('data-headerbg', 'transparent').setAttribute('style', 'background-image:url(/themes/custom/agarica/patternlibrary/agaric/images/fpo-video-poster.png)') %} -{% endif %} -{% if false %} - {% set header_section_attributes = header_section_attributes.removeClass('is-dark').setAttribute('data-headerbg', 'light') %} -{% endif %} - -{% if node %} - {% set header_section_attributes = header_section_attributes.removeClass('hero', 'is-dark', 'hero-main', 'is-large').removeAttribute(['data-headerbg', 'style']) %} + {% set header_section_attributes = header_section_attributes.addClass(['hero', 'is-dark', 'hero-main', 'is-large']).setAttribute('data-headerbg', 'transparent').setAttribute('style', 'background-image:url(/themes/custom/agarica/patternlibrary/agaric/images/fpo-video-poster.png)') %} +{% elseif not node %} + {% set header_section_attributes = header_section_attributes.addClass(['hero']).setAttribute('data-headerbg', 'light') %} {% endif %} {% block header %} -{# We've moved the header section to the content level for nodes #} -{% if not node %} +{# We've moved the header section to the content level for nodes, with an + exception for the front page. #} +{% if not node or is_front %} {% block header_title %} {% if page.header %} {# Header hero region #}