Update view paragraph template to add section wrapper
if it's busted out of the content flow, anyhow.
This commit is contained in:
parent
e3200c4a6f
commit
39af4281ab
1 changed files with 11 additions and 2 deletions
|
@ -1,11 +1,16 @@
|
||||||
{# extends 'paragraph.html.twig' #}
|
{# For available variables see paragraph.html.twig #}
|
||||||
|
|
||||||
{%
|
{%
|
||||||
set classes = [
|
set section_classes = [
|
||||||
'section',
|
'section',
|
||||||
not paragraph.isPublished() ? 'paragraph--unpublished'
|
not paragraph.isPublished() ? 'paragraph--unpublished'
|
||||||
]
|
]
|
||||||
%}
|
%}
|
||||||
|
{% if paragraph.field_style_escape_flow == true %}
|
||||||
|
{% set section_attributes = create_attribute().addClass(section_classes).setAttribute('data-headerbg', 'light') %}
|
||||||
|
<section {{ section_attributes }}>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block paragraph %}
|
{% block paragraph %}
|
||||||
<div{{ attributes.addClass(classes) }}>
|
<div{{ attributes.addClass(classes) }}>
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@ -13,3 +18,7 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock paragraph %}
|
{% endblock paragraph %}
|
||||||
|
|
||||||
|
{% if paragraph.field_style_escape_flow.value == true %}
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue