Update view paragraph template to add section wrapper

if it's busted out of the content flow, anyhow.
This commit is contained in:
benjamin melançon 2018-11-20 03:12:00 -05:00
parent e3200c4a6f
commit 39af4281ab

View file

@ -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 %}