{% extends "page.html" %} {% block content_body %} {# build list of pages where the slugs correspond to an entry in page.wide_cards; some hackiness required to keep the original order #} {% set wcards = [] %} {% for wide_card in page.wide_cards %} {% do wcards.append(pages | selectattr("slug", "==", wide_card) | list | first) if pages | selectattr("slug", "==", wide_card) | list | first is defined %} {% endfor %} {# now we can finally iterate over the correct pages (max. 4 pages) #} {% for wcard in wcards[:4] %}

{{ wcard.title }}

{% endfor %} {% endblock content_body %} {% block content_footer %} {% endblock content_footer %}