{% extends 'sections/default/_base/default.twig' %} {% set options = options|default({}) + { teaser_pool_params: [], teaserlist_list_limit: 1, sections_variant: 'teaserlist', teaser_imagesize: 'teaser_portrait', } %} {# Logik ------------------------------------------------------------------------------------------------------------ #} {% set globals = RelationList.getGlobals(section.data) %} {% set layout = layout|default(globals.layout|default('inline')) %} {% 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 %} {# set objects to an empty array, 'cause we don't wanna 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 %}