{% extends 'sections/default/_base/default.twig' %} {% set options = options|default({}) + { teaser_pool_params: [], teaser_imagesize: 'teaser_landscape', teaserlist_list_limit: 1, sections_variant: 'teaserlist', sections_autowrapper_behavior: 'full', } %} {# 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 globals = RelationList.getGlobals(section.data) %} {% set layout = layout|default(globals.layout|default('default')) %} {% set pool = RelationList.getConfig(section_blockconfig).pool|default %} {% set length = globals.length|default(options.teaserlist_list_limit) %} {% set items = RelationList.getItems(section.data) %} {% set length = max(length, items|default|length) %} {% if pool and length %} {% set items = RelationFill.getItems(pool, length, globals + options.teaser_pool_params, items) %} {% endif %} {% if layout == 'visual' or layout =='3col' %} {% set options = { teaser_imagesize: 'teaser_square', } + options %} {% endif %} {# 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 = generateTeasers(objects, { teaserImageSize: options.teaser_imagesize }) %} {# Templating ------------------------------------------------------------------------------------------------------- #} {% block section_content %} {% include [ "blocks/list/" ~ layout ~ ".twig", "blocks/list/default.twig" ] with { teasers: teasers, options: options } %} {% endblock %}