From 75f5d32b5b01472ce8d3f0f62be667e902a22e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 14 Nov 2018 14:05:18 -0500 Subject: [PATCH] For titlebars with images, make it the background image --- agaric/templates/paragraph/paragraph--title.html.twig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agaric/templates/paragraph/paragraph--title.html.twig b/agaric/templates/paragraph/paragraph--title.html.twig index a943d01..f6fa82d 100644 --- a/agaric/templates/paragraph/paragraph--title.html.twig +++ b/agaric/templates/paragraph/paragraph--title.html.twig @@ -51,6 +51,10 @@ {% set classes = classes|merge(['hero-project']) %} {% endif %} +{% if paragraph.field_style_titlebar is not empty 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 %}