{% extends 'layout/default.html.twig' %}
{% set detailUrl = getDetailLink(news) %}
{% do elements_head_title(news.seoTitle ?: news.title|raw, true) %}
{% do elements_head_meta(news.seoDescription ?: news.intro|raw, true) %}
{% do elements_canonical(detailUrl) %}
{% do elements_opengraph().setUrl(detailUrl) %}
{% do elements_opengraph().setDescription(news.seoDescription ?: news.intro) %}
{% if news.image %}
{% do elements_opengraph().addImage(news.image.thumbnail('content-hero')) %}
{% endif %}
{% do breadcrumbHelper().add({
'parentId': document.getId(),
'url': detailUrl,
'label': news.title
}) %}
{% block content %}
{{ pimcore_placeholder('jsFile').set('js/news') }}
{{ include('includes/heros/content-hero.html.twig', {
'title': news.title,
'toptitle': elements_dateFormat(news.publishDate, 'date-long', 'de'),
'image': news.image,
'className': 'content-block',
'heroType': 'standard'
}, with_context = false) }}
{% set downloads = news.downloads|filter(d => d.asset or d.localizedAsset) %}
<section class="content-block container">
<div class="row gy-5">
<div class="col-xl-2 col-md-3">
{% if downloads %}
<ul class="list-unstyled gap-3 d-flex flex-column border-top-light-grey pt-4">
{% for downloadAsset in downloads %}
{% set asset = downloadAsset.asset ?: downloadAsset.localizedAsset %}
<li>
<a href="{{ asset.path ~ asset.filename }}" download class="download-item">
<span class="icon icon-download download-item__icon text-secondary"
aria-label="{{ 'news.detail.download'|trans }}" title="{{ 'news.detail.download'|trans }}"
></span>
{{ downloadAsset.name }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="col-xl-6 col-md offset-md-1">
{{ include('includes/content/wysiwyg.html.twig',{
'hideTitle': true,
'text': news.intro,
'className': 'js-fade-in wysiwyg--container-width font-default-bold'
}, with_context = false) }}
</div>
</div>
</section>
{% set content = news.contentArea %}
{% if content and content.items is not empty %}
{% for block in content.items %}
{{ include('news/fieldcollections/' ~ block.type ~ '.html.twig', { 'block' : block }, true, true) }}
{% endfor %}
{% endif %}
{% if downloads %}
{{ include('includes/content/download-box.html.twig', { 'items': downloads }, with_context = false) }}
{% endif %}
{% if news.contact %}
{{ include('includes/content/contact-block.html.twig',{
'className': 'container-narrow content-block js-fade-in',
'contact': news.contact
}, with_context = false) }}
{% endif %}
{{ include('includes/content/mixed-teaser-slider.html.twig', {
'classNames': 'content-block--large',
'toptitle': ' ',
'title': 'news.detail.slider-title'|trans,
'isCardTeser': true,
'teasers': newsList|default([]),
'editmode': false
}, with_context = false) }}
{% endblock %}
{% block jld_root %}
{{ jld_root(news) }}
{% endblock %}