<div class="cards-container"> <div class="cards-container__inner"> {% for item in block.content.items %} {% set card = post_type[~item.post_type~].items[~item.id~] %} {% set card = card|merge(item.attr) %} <div class="card card-grid-item card-grid-item--{{card.category|lower}}{% if card.featured_image != null %} card-grid-item--has-background{% endif %}"> {% if card.featured_image != null %} <div class="card-grid-item__bg">{% include "../layout/partials/picture.twig" with {"image": card.featured_image } %}</div> {% endif %} <div class="card-grid-item__header"> <p class="card__category">{{card.category}}</p> </div> {% if card.category == "Eventi" %} <p class="card__date">{{card.date.start|date('d')}} - {{card.date.end|date('d.m.Y')}}</p> {% endif %} <div class="card__title"> <p>{{card.title}}</p> </div> </div> {% endfor %} </div> </div>