{% extends 'sections/default/_base/default.twig' %} {% set options = options|default({}) + { sections_variant: 'teaserlist', sections_autowrapper_behavior: 'full', teaser_imagesize: 'teaser_square', } %} {# Since we can invoke this template multiple times and the value of list_label will be set on the first time, we need to override it here, otherwise the first value will be used for all labels #} {% set options = { list_label: RelationList.getGlobals(section.data).title|default(false), } + options %} {# Logik ------------------------------------------------------------------------------------------------------------ #} {% set items = RelationList.getItems(section.data) %} {# set objects to an empty array, because we don't want to have any objects from outside the template #} {% set objects = [] %} {% for item in items %} {% set objects = objects|merge([item.object]) %} {% endfor %} {# convert items to teasers #} {% set teasers = [] %} {% for object in objects %} {% set image = false %} {% if object.image.items|default([])|first %} {% set image = thumbnail(object.image.items|default([])|first, options.teaser_imagesize)%} {% endif %} {% set teaser = { title: object.title|trim|default, role: object.role|striptags|default, phone: object.phone|striptags|default, email: object.email|striptags|default, image: image, } %} {% set teasers = teasers|merge([teaser]) %} {% endfor %} {# Templating ------------------------------------------------------------------------------------------------------- #} {% block section_content %} {% include [ "blocks/list/contacts.twig" ] with { teasers: teasers, options: options } %} {% endblock %}