Newer
Older
pre-www / src / layout / single-event.twig
{% if paths_base == null %}
    {% set paths_base = '../..' %}
{% endif %}

{% set type = "events" %}

{% extends "base.twig" %}

{% set bodyClasses = 'single single-event' %}

{% set post = post_type.events.items[currentPost] %}

{% block breadcrumbs %}

    {% set breadcrumbs_block = 
        {
            "post_type": type,
            "show_terms": false,
            "current_id": currentPost 
        }
    %}
    {% include '../blocks/breadcrumbs.twig' with {'block': breadcrumbs_block } %}

{% endblock %}

{% block content %}

    <div class="grid-container event-image">
        {% include "../layout/partials/picture.twig" with {"image": post.featured_image } %}
    </div>
    
    <div class="grid-container event-content">
        <div class="columns">
            <div class="w-full lg:w-1/2 column">
                <div class="sticky-column">
                    {% set event_info = {
                        "key": "grid-list",
                        "content": {
                            "items": [
                                {
                                    "label": "Data",
                                    "text": post.date.start|date('d.m')
                                },
                                {
                                    "label": "Orario",
                                    "text": post.date.start|date('h:m')
                                },
                                {
                                    "label": "Categoria",
                                    "text": taxonomies.events.terms[1].items[~post.terms.1.1~].name
                                },
                                {
                                    "label": "Luogo",
                                    "text": taxonomies.events.terms[0].items[~post.terms.0.1~].name
                                }
                            ]
                        }

                    } %}
                    {% include "../blocks/grid-list.twig" with {"block": event_info } %}
                    {% set event_signup = {
                        "key": "link",
                        "url": "https://www.eventbrite.com",
                        "content": {
                            "name": "Vai alla registrazione",
                            "external_name": "Eventbrite"
                        }
                    } %}
                    {% include "../blocks/link.twig" with {"block": event_signup } %}
                    
                </div>
            </div>
            <div class="w-full lg:w-1/2 column">
                <p class="event-subtitle">{{post.subtitle}}</p>
                {{post.content}}
            </div>
        </div>
    </div>

    {% for block in post.blocks %}
        {% include '../blocks/'~block.key~'.twig' with {'block': block } %}
    {% endfor %}

{% endblock %}