Newer
Older
pre-www / src / blocks / query-loop.twig
{# 
 # Blocco query loop
 #}
 
<div class="block-container block-{{key}} {{block.classes}}">
    <div class="{{block.key}}__inner">
        {% if block.type == "card" %}
            <div class="cards-container">
                <div class="cards-container__inner">
                    {% for id in block.query.items %}
                        {% set post = post_type[block.query.post_type].items[id] %}
                            {% include "../layout/partials/card.twig" with {"card": post } %}
                    {% endfor %}
                </div>
            </div>
        {% else %}
            <div class="block-tease-row block-container">
                <div class="tease-wrapper">
                    {% for id in block.query.items %}
                        {% set post = post_type[block.query.post_type].items[id] %}
                            {% include "../layout/partials/tease.twig" with {"post": post } %}
                    {% endfor %}
                </div>
            </div>
        {% endif %}
    </div>
</div>