Fix conditionals in template
This commit is contained in:
parent
b3c1ff22d7
commit
7380e88727
1 changed files with 4 additions and 4 deletions
|
@ -44,10 +44,10 @@
|
||||||
not paragraph.isPublished() ? 'paragraph--unpublished'
|
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]) %}
|
{% set classes = classes|merge(['is-'~paragraph.field_style_color.value]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if paragraph.field_style_titlebar is empty %}
|
{% if paragraph.field_style_titlebar.value == false %}
|
||||||
{% set classes = classes|merge(['hero-project']) %}
|
{% set classes = classes|merge(['hero-project']) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if paragraph.field_style_classes is not empty %}
|
{% if paragraph.field_style_classes is not empty %}
|
||||||
|
@ -58,14 +58,14 @@
|
||||||
{% set classes = classes|merge(styles) %}
|
{% set classes = classes|merge(styles) %}
|
||||||
{% endif %}
|
{% 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)~')') %}
|
{% set attributes = attributes.setAttribute('data-headerbg', 'transparent').setAttribute('style', 'background-image: url('~file_url(paragraph.field_image.entity.uri.value)~')') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% block paragraph %}
|
{% block paragraph %}
|
||||||
<section{{ attributes.addClass(classes) }}>
|
<section{{ attributes.addClass(classes) }}>
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if paragraph.field_style_titlebar is empty %}
|
{% if paragraph.field_style_titlebar.value == false %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="hero-image">
|
<div class="hero-image">
|
||||||
{{ content.field_image }}
|
{{ content.field_image }}
|
||||||
|
|
Loading…
Reference in a new issue