Fix conditionals in template

This commit is contained in:
benjamin melançon 2018-11-15 01:09:30 -05:00
parent b3c1ff22d7
commit 7380e88727

View file

@ -44,10 +44,10 @@
not paragraph.isPublished() ? 'paragraph--unpublished'
]
%}
{% if paragraph.field_style_color %}
{% if paragraph.field_style_color is not empty %}
{% set classes = classes|merge(['is-'~paragraph.field_style_color.value]) %}
{% endif %}
{% if paragraph.field_style_titlebar is empty %}
{% if paragraph.field_style_titlebar.value == false %}
{% set classes = classes|merge(['hero-project']) %}
{% endif %}
{% if paragraph.field_style_classes is not empty %}
@ -58,14 +58,14 @@
{% set classes = classes|merge(styles) %}
{% endif %}
{% if paragraph.field_style_titlebar is not empty and paragraph.field_image is not empty %}
{% if paragraph.field_style_titlebar.value == true and paragraph.field_image is not empty %}
{% set attributes = attributes.setAttribute('data-headerbg', 'transparent').setAttribute('style', 'background-image: url('~file_url(paragraph.field_image.entity.uri.value)~')') %}
{% endif %}
{% block paragraph %}
<section{{ attributes.addClass(classes) }}>
{% block content %}
{% if paragraph.field_style_titlebar is empty %}
{% if paragraph.field_style_titlebar.value == false %}
<div class="container">
<div class="hero-image">
{{ content.field_image }}