Move header from page to layout where it can be controlled by node
This commit is contained in:
parent
a408e91158
commit
c8b3ea1481
1 changed files with 37 additions and 0 deletions
37
agaric/templates/layout/layout--onecol.html.twig
Normal file
37
agaric/templates/layout/layout--onecol.html.twig
Normal file
|
@ -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 <div>.
|
||||||
|
*
|
||||||
|
* @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 %}
|
||||||
|
<div{{ attributes.addClass(classes) }}>
|
||||||
|
<div {{ region_attributes.content }}>
|
||||||
|
<section{{ header_section_attributes }}>
|
||||||
|
{# Header hero region #}
|
||||||
|
<div class="hero-body">
|
||||||
|
<div class="container">
|
||||||
|
<div class="titlebar">
|
||||||
|
{{ content.title }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ content.content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
Loading…
Reference in a new issue