For titlebars with images, make it the background image

This commit is contained in:
benjamin melançon 2018-11-14 14:05:18 -05:00
parent d372e8375e
commit 75f5d32b5b

View file

@ -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 %}
<section{{ attributes.addClass(classes) }}>
{% block content %}