{% if paths_base == null %}
{% set paths_base = '../..' %}
{% endif %}
{% set type = "news" %}
{% extends "base.twig" %}
{% set bodyClasses = 'single single-news' %}
{% set post = post_type.news.items[currentPost] %}
{% block breadcrumbs %}
{% set breadcrumbs_block =
{
"post_type": "news",
"show_terms": false,
"current_id": currentPost
}
%}
{% include '../blocks/breadcrumbs.twig' with {'block': breadcrumbs_block } %}
{% endblock %}
{% block content %}
<div class="grid-container news-main">
<div class="columns">
<div class="w-full lg:w-1/2 column">
<div class="news-col-sticky">
<div class="news-image">
{% include "../layout/partials/picture.twig" with {"image": post.featured_image } %}
</div>
<div class="news-info">
{% set news_info_content_items = [
{
"label": "Data",
"text": post.date|date('d.m.Y')
}
] %}
{% for term in post.terms %}
{% set parent_post_term = term[0] %}
{% set post_term = term[1] %}
{% set news_info_content_items = news_info_content_items|merge([
{
"label": taxonomies[~type~].terms[~parent_post_term~].name,
"text": taxonomies[~type~].terms[~parent_post_term~].items[~post_term~].name
}
]) %}
{% endfor %}
{% set news_info =
{
"key": "grid-list",
"content": {
"items": news_info_content_items
}
}
%}
{% include '../blocks/grid-list.twig' with {'block': news_info } %}
</div>
</div>
</div>
<div class="w-full lg:w-1/2 column">
{% if post.abstract %}
<p class="h4">{{post.abstract}}</p>
{% endif %}
{{post.content}}
{% if post.content_links %}
{% set links = {
"key": "links-list",
"classes": "",
"links_size": "sm",
"content": {
"list": post.content_links
}
} %}
{% include '../blocks/links-list.twig' with {'block': links } %}
{% endif %}
</div>
</div>
</div>
{% if post.related_events != null %}
<div class="grid-container spacing-5">
{# Titolo #}
{% set related_events =
{
"key": "title",
"tag": "h2",
"classes": "block-title--sm block-title--divider",
"content": {
"title": "Eventi correlati"
}
}
%}
{% include '../blocks/title.twig' with {'block': related_events } %}
{# Correlati #}
{% set events = post.related_events %}
{% for id in events %}
{% set event = post_type.eventi.items[~id~] %}
<div class="post-row post-row--border-grey">
<div class="post-row__inner event-item">
<div class="event-item__info">
<p class="event-item__date">
<span>{{event.date.start|date('d.m.Y')}} {% if event.allday %}/ Tutto il giorno{% endif %}</span>
</p>
<div class="event-item__location">{{event.place}}</div>
</div>
<div>
<p class="event-item__title">{{event.title}}</p>
<p class="event-item__excerpt">{{event.excerpt}}</p>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% if post.related_subjects != null %}
<div class="grid-container">
{# Titolo #}
{% set enrollment_block_title =
{
"key": "title",
"tag": "h2",
"classes": "block-title--sm block-title--divider",
"content": {
"title": "Argomenti correlati"
}
}
%}
{% include '../blocks/title.twig' with {'block': enrollment_block_title } %}
<div class="cards-container">
<div class="cards-container__inner">
{% for subject in post.related_subjects %}
{% set card = post_type[~subject.post_type~].items[~subject.id~] %}
{% include './partials/card.twig' with {'card': card } %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if post.related_contacts %}
{% set news_contacts_items = [] %}
{% for contact in post.related_contacts %}
{% set news_contacts_items = news_contacts_items|merge([
post_type[~contact.type~].items[~contact.id~]
]) %}
{% endfor %}
{% set news_contacts = {
"key": "contacts-section",
"classes": "spacing-4",
"title": {
"key": "title",
"tag": "h2",
"classes": "block-title--sm",
"content": {
"title": "Contatti",
"link": {
"label": "Vai alla rubrica contatti",
"url": "/pages/contatti/strutture.html"
}
}
},
"content": [
{
"items": news_contacts_items
}
]
} %}
{% include '../blocks/contacts-section.twig' with {'block': news_contacts, 'id': 'contatti' } %}
{% endif %}
{% if post.related_news %}
<div class="grid-container">
{# Titolo #}
{% set news_block_title =
{
"key": "title",
"tag": "h2",
"classes": "block-title--sm block-title--divider",
"content": {
"title": "Novità dall’ambito architettura",
"link": {
"label": "Vedi tutte",
"url": "#"
}
}
}
%}
{% include '../blocks/title.twig' with {'block': news_block_title } %}
{# News posts #}
{% set news_tease_row = {
"key": "tease-row",
"classes": "",
"content": {
"featured": [
{
"post_type": "news",
"items": post.related_news
}
]
}
} %}
{% include '../blocks/tease-row.twig' with {'block': news_tease_row } %}
</div>
{% endif %}
<div class="news-posts-nav">
<div class="news-posts-nav__inner">
<a href="#">
<span>Notizia precedente</span>
<span>Agenzia del Demanio e Università Iuav di Venezia insieme...</span>
</a>
<a href="#">
<span>Notizia successiva</span>
<span>Collaboratori alla didattica Iuav ottengono una menzione...</span>
</a>
</div>
</div>
{% endblock %}