Newer
Older
pre-www / src / pages / avvisi.twig
@EcosistemaWebIuav EcosistemaWebIuav on 28 Jun 3 KB feat: placeholder img test
{% extends "../layout/archive.twig" %}

{% set type = 'notices' %}

{% block archive_col_1 %}
    <nav class="posts-archive-navigation">
        <ul>
            {% set queried_post_types = [
                "news", "events", "notices"
            ] %}
            {% for queried_post in queried_post_types %}
                <li class=" {% if queried_post == type %}is-active{% endif %}"><a href="{{post_type[~queried_post~].url}}">{{post_type[~queried_post~].name}}</a></li>
            {% endfor %}
        </ul>
    </nav>
{% endblock %}

{% block archive_col_2 %}
    {# {% set posts_archive_description = {
        "key": "paragraph",
        "content": post_type[~type~].description
    } %}
    {% include "../blocks/paragraph.twig" with {"block": posts_archive_description } %} #}
    <div class="posts-archive-description">
        <p>{{post_type[~type~].description}}</p>
    </div>
{% endblock %}

{% block filters %}

    <div>
        {% set archive_filters = {
            "key": "filters",
            "classes": "",
            "content": {
                "items": [
                    {
                        "type": "term",
                        "post_type": type,
                        "id": 0
                    },
                    {
                        "type": "term",
                        "post_type": type,
                        "id": 1
                    }
                ],
                "has_search": true
            }
            } %}
        {% include "../blocks/filters.twig" with {"block": archive_filters } %}
    </div>

{% endblock %}

{% block posts %}

    <div class="block-tease-row block-container">

        <div class="tease-wrapper">
            {% for post in post_type[~type~].items|slice(0,1) %}
                <a href="{{post.url}}" class="tease tease--test" data-tease-cover>
                    <div class="tease__img">
                    {% if post.featured_image %}
                        {% include "./picture.twig" with {"image": post.featured_image } %}
                    {% endif %}
                    </div>
                    
                    <div class="tease__main">
                        <div class="tease-main-header">
                            {% for term in post.terms|slice(0,1) %}
                                {% set parent_post_term = term[0] %}
                                {% set post_term = term[1] %}
                                <span>{{taxonomies[~type~].terms[~parent_post_term~].items[~post_term~].name}}</span>
                            {% endfor %}
                            <span>{{post.date|date('d.m.Y')}}</span>
                        </div>
                        <p class="tease-main-title">{{post.title}}</p>
                    </div>
                </a>
            {% endfor %}
            {% for post in post_type[~type~].items|slice(1) %}
                {% include "../layout/partials/tease.twig" with {"post": post } %}
            {% endfor %}
        </div>

    </div>

{% endblock %}

{% block pagination %}
    {% include "../blocks/pagination.twig" %}
{% endblock %}