From c8b3ea14815f575cbd5684ad0805904a0adc0416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Mon, 22 Oct 2018 09:50:20 -0400 Subject: [PATCH] Move header from page to layout where it can be controlled by node --- .../templates/layout/layout--onecol.html.twig | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 agaric/templates/layout/layout--onecol.html.twig diff --git a/agaric/templates/layout/layout--onecol.html.twig b/agaric/templates/layout/layout--onecol.html.twig new file mode 100644 index 0000000..edf841b --- /dev/null +++ b/agaric/templates/layout/layout--onecol.html.twig @@ -0,0 +1,37 @@ +{# +/** + * @file + * Default theme implementation to display a one-column layout. + * + * Available variables: + * - content: The content for this layout. + * - attributes: HTML attributes for the layout
. + * + * @ingroup themeable + */ +#} +{% set bundle = content['#node'].bundle %} + +{% set header_section_attributes = create_attribute({'class': ['hero', 'is-dark']}) %} +{% 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 content %} + +
+ + {# Header hero region #} +
+
+
+ {{ content.title }} +
+
+
+
+ {{ content.content }} +
+ +{% endif %}