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">
                    {% if post.is_canceled %}
                        <div class="block-alert"><div class="block-alert__inner">Evento cancellato</div></div>
                    {% endif %}
                    
                    {% 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:i')
                                },
                                {
                                    "label": "Categoria",
                                    "text": taxonomies.events.terms[1].items[~post.terms.0.1.0].name
                                },
                                {
                                    "label": "Luogo",
                                    "text": taxonomies.events.terms[0].items[~post.terms.1.1.0].name
                                }
                            ]
                        }

                    } %}
                    {% include "../blocks/grid-list.twig" with {"block": event_info } %}
                    {% set event_signup = {
                        "key": "link",
                        "classes": "block-link--sm",
                        "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 %}