Make image background image to match design precisely

Also, try to strip comments so these 'data' fields still work in debug mode
This commit is contained in:
benjamin melançon 2018-11-12 23:25:36 -05:00
parent a52a3e69ed
commit ad8fd87fe2

View file

@ -46,13 +46,12 @@
] ]
%} %}
{% if content.field_style_color %} {% if content.field_style_color %}
{% set classes = classes|merge(['is-'~content.field_style_color|render|trim]) %} {% set classes = classes|merge(['is-'~content.field_style_color|render|striptags|trim]) %}
{% endif %} {% endif %}
{% block paragraph %} {% block paragraph %}
<a href="{{ path('entity.node.canonical', {'node': paragraph.getParentEntity().id()}) }}"{{ attributes.addClass(classes) }}> <a href="{{ path('entity.node.canonical', {'node': paragraph.getParentEntity().id()}) }}"{{ attributes.addClass(classes) }}>
{% block content %} {% block content %}
<div class="card-image"> <div class="card-image" style="background-image: url({{ content.field_image|render|striptags|trim }}">
{{ content.field_image }}
</div> </div>
<div class="card-content"> <div class="card-content">
{{ content.field_title }} {{ content.field_title }}