Refactor existing event paragraph template

References 
This commit is contained in:
Oliver Davies 2020-10-24 20:06:21 +01:00
parent d1c7cc01a7
commit 79445b8641

View file

@ -47,26 +47,30 @@
] ]
%} %}
{% block paragraph %} {% block paragraph %}
{% set date = paragraph.field_date.0.value %}
<div{{ attributes.addClass(classes).addClass('') }}> {% set is_remote = paragraph.field_remote.0.value %}
{% block content %} {% set location = paragraph.field_location.0.value %}
{% set name = paragraph.field_name.0.value %}
{% set url = paragraph.field_link.0.url %} {% set url = paragraph.field_link.0.url %}
<div{{ attributes.addClass(classes) }}>
{% block content %}
{% if url %} {% if url %}
{{ link(paragraph.field_name.0.value, url) -}} {{ link(name, url) -}}
{% else %} {% else %}
{{ content.field_name -}} {{ name -}}
{% endif -%} {% endif -%}
{%- if content.field_location is not empty %} {%- if location is not empty %}
{{ 'in'|t }} {{ 'in'|t }}
{{ content.field_location }} {{ location }}
{%- endif %} {%- endif %}
{% if paragraph.field_remote.0.value %} {% if is_remote %}
{{ '(Remote)'|t }} {{ '(Remote)'|t }}
{% endif %} {% endif %}
<span>- {{ paragraph.field_date.0.value|date('jS F Y') }}</span> <span>- {{ date|date('jS F Y') }}</span>
{{ content.without('field_remote') }} {{ content.without('field_remote') }}
{% endblock %} {% endblock %}