From 7380e887274a4a2c8c51b70fe51ab2a15e049e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Thu, 15 Nov 2018 01:09:30 -0500 Subject: [PATCH] Fix conditionals in template --- agaric/templates/paragraph/paragraph--title.html.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agaric/templates/paragraph/paragraph--title.html.twig b/agaric/templates/paragraph/paragraph--title.html.twig index ab8a051..6048bac 100644 --- a/agaric/templates/paragraph/paragraph--title.html.twig +++ b/agaric/templates/paragraph/paragraph--title.html.twig @@ -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 %} {% block content %} - {% if paragraph.field_style_titlebar is empty %} + {% if paragraph.field_style_titlebar.value == false %}
{{ content.field_image }}