{% extends 'pages/_base/default.twig' %} {% set options = options|default({}) + { portal_adslot_type: 'rail', portal_adslot_class: 'sticky-ad advertisement-rail', portal_highlight_imagesize: 'teaser_landscape_large', portal_teaser_imagesize: 'teaser_landscape', portal_highlight: true, portal_teaser_fixed: 'teasers', portal_teaser_pool: false, portal_teaser_pool_params: [], portal_list_limit: 13, page_type: 'portal', teaser_container_class: 'col-sm-6 col-12', sections_autowrapper_containerclass: 'container', sections_autowrapper_rowclass: 'row', sections_autowrapper_colclass_default: 'col-md-8', sections_autowrapper_adcolclass: 'col-md-4 text-center', } %} {# Required variables # record - the portal page itself # objects - array of content objects (records) to display in teaserlist (optional, can select it's own records via pool parameters) # teasers - array of teasers in addition converted objects above (optional, will use it's own records) #} {# Logik ------------------------------------------------------------------------------------------------------------ #} {% set objects = objects|default([]) %} {% set items = [] %} {# load fixed elements if a record field for it was specified #} {% if options.portal_teaser_fixed and record[options.portal_teaser_fixed]|default %} {% set items = RelationList.getItems(record[options.portal_teaser_fixed]) %} {% endif %} {# select content records to display #} {% if options.portal_teaser_pool %} {% set parameters = RelationList.getGlobals(record.teasers) + options.portal_teaser_pool_params %} {% set items = RelationFill.getItems(options.portal_teaser_pool, options.portal_list_limit, parameters, items) %} {% endif %} {% for item in items %} {% set objects = objects|merge([item.object]) %} {% endfor %} {# convert records to highlight (if needed) #} {% if options.portal_highlight and objects and not highlight|default %} {% set object = objects|first %} {% set objects = objects|slice(1) %} {% set highlight = generateTeaser(object, { teaserImageSize: options.portal_highlight_imagesize }) %} {% endif %} {# convert records to teasers #} {% set teasers = teasers|default([]) %} {% set teasers = teasers|merge(generateTeasers(objects, { teaserImageSize: options.portal_teaser_imagesize })) %} {# Templating ------------------------------------------------------------------------------------------------------- #} {% block content %} {% block portal_intro %} {% include 'blocks/intro/portal.twig' %} {% endblock %} {% block portal_highlight %} {% if highlight|default %} {% include "blocks/highlight/default.twig" with { highlight: highlight, options: options } %} {% endif %} {% endblock %} {% block portal_teasers %}
{% include [ "blocks/list/default.twig" ] with { teasers: teasers, options: options } %}
{# add optional ad slot #}
{% include "components/ads/slot.twig" with { options: { slot_type: options.portal_adslot_type, slot_class: options.portal_adslot_class, }} %}
{% endblock %} {% endblock %}