Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit a0a6c14c authored by escuriola's avatar escuriola Committed by drishu
Browse files

OEL-1522: Theming teaser and content type. Improve meta array. Inline variables.

parent 57144910
No related branches found
No related tags found
1 merge request!162OEL-1552: Theme the person content type
......@@ -4,17 +4,6 @@
* Person content banner display.
*/
#}
{% set _meta = [] %}
{% if not node.oe_sc_person_occupation.isEmpty() %}
{% set _meta = _meta|merge([content.oe_sc_person_occupation|field_value]) %}
{% endif %}
{% if not node.oe_sc_person_position.isEmpty() %}
{% set _meta = _meta|merge([content.oe_sc_person_position|field_value]) %}
{% endif %}
{% if not node.oe_sc_person_country.isEmpty() %}
{% set _meta = _meta|merge([content.oe_sc_person_country|field_value]) %}
{% endif %}
{% set _content %}
{{ content.oe_summary|field_value }}
<div class="mt-2-5 mb-2">
......@@ -25,7 +14,11 @@
}
) %}
<div class="mb-3 mb-md-0 d-block d-md-inline-block me-md-4-5">
{{ pattern('link', _link) }}
{{ pattern('link', _link|merge(
{
'attributes': create_attribute().addClass(['d-block', 'd-md-inline-block', 'mb-3', 'mb-md-0', 'standalone'])
}
) ) }}
</div>
{% endfor %}
</div>
......@@ -36,6 +29,10 @@
title: label,
content: _content,
image: image,
meta: _meta,
meta: [
content.oe_sc_person_occupation|field_value,
content.oe_sc_person_position|field_value,
content.oe_sc_person_country|field_value,
]|filter(element => element is not empty),
}) }}
</div>
......@@ -7,19 +7,15 @@
{% set _title %}
<a class="standalone" href="{{ url }}">{{ label }}</a>
{% endset %}
{% set _meta = [] %}
{% if not node.oe_sc_person_occupation.isEmpty() %}
{% set _meta = _meta|merge([content.oe_sc_person_occupation|field_value]) %}
{% endif %}
{% if not node.oe_sc_person_position.isEmpty() %}
{% set _meta = _meta|merge([content.oe_sc_person_position|field_value]) %}
{% endif %}
{% block content %}
{{ pattern('card', {
variant: 'search',
title: _title,
image: image,
meta: _meta,
meta: [
content.oe_sc_person_occupation|field_value,
content.oe_sc_person_position|field_value,
]|filter(element => element is not empty),
attributes: attributes,
}) }}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment