templates/news/detail.html.twig line 1

Open in your IDE?
  1. {% extends 'layout/default.html.twig' %}
  2. {% set detailUrl = getDetailLink(news) %}
  3. {% do elements_head_title(news.seoTitle ?: news.title|raw, true) %}
  4. {% do elements_head_meta(news.seoDescription ?: news.intro|raw, true) %}
  5. {% do elements_canonical(detailUrl) %}
  6. {% do elements_opengraph().setUrl(detailUrl) %}
  7. {% do elements_opengraph().setDescription(news.seoDescription ?: news.intro) %}
  8. {% if news.image %}
  9.     {% do elements_opengraph().addImage(news.image.thumbnail('content-hero')) %}
  10. {% endif %}
  11. {% do breadcrumbHelper().add({
  12.     'parentId': document.getId(),
  13.     'url': detailUrl,
  14.     'label': news.title
  15. }) %}
  16. {% block content %}
  17.     {{ pimcore_placeholder('jsFile').set('js/news') }}
  18.     {{ include('includes/heros/content-hero.html.twig', {
  19.         'title': news.title,
  20.         'toptitle': elements_dateFormat(news.publishDate, 'date-long', 'de'),
  21.         'image': news.image,
  22.         'className': 'content-block',
  23.         'heroType': 'standard'
  24.     }, with_context = false) }}
  25.     {% set downloads = news.downloads|filter(d => d.asset or d.localizedAsset) %}
  26.     <section class="content-block container">
  27.         <div class="row gy-5">
  28.             <div class="col-xl-2 col-md-3">
  29.                 {% if downloads %}
  30.                     <ul class="list-unstyled gap-3 d-flex flex-column border-top-light-grey pt-4">
  31.                         {% for downloadAsset in downloads %}
  32.                             {% set asset = downloadAsset.asset ?: downloadAsset.localizedAsset %}
  33.                             <li>
  34.                                 <a href="{{ asset.path ~ asset.filename }}" download class="download-item">
  35.                                     <span class="icon icon-download download-item__icon text-secondary"
  36.                                           aria-label="{{ 'news.detail.download'|trans }}" title="{{ 'news.detail.download'|trans }}"
  37.                                     ></span>
  38.                                     {{ downloadAsset.name }}
  39.                                 </a>
  40.                             </li>
  41.                         {% endfor %}
  42.                     </ul>
  43.                 {% endif %}
  44.             </div>
  45.             <div class="col-xl-6 col-md offset-md-1">
  46.                 {{ include('includes/content/wysiwyg.html.twig',{
  47.                     'hideTitle': true,
  48.                     'text': news.intro,
  49.                     'className': 'js-fade-in wysiwyg--container-width font-default-bold'
  50.                 }, with_context = false) }}
  51.             </div>
  52.         </div>
  53.     </section>
  54.     {% set content = news.contentArea %}
  55.     {% if content and content.items is not empty %}
  56.         {% for block in content.items %}
  57.             {{ include('news/fieldcollections/' ~ block.type ~ '.html.twig', { 'block' : block }, true, true) }}
  58.         {% endfor %}
  59.     {% endif %}
  60.     {% if downloads %}
  61.         {{ include('includes/content/download-box.html.twig', { 'items': downloads }, with_context = false) }}
  62.     {% endif %}
  63.     {% if news.contact %}
  64.         {{ include('includes/content/contact-block.html.twig',{
  65.             'className': 'container-narrow content-block js-fade-in',
  66.             'contact': news.contact
  67.         }, with_context = false) }}
  68.     {% endif %}
  69.     {{ include('includes/content/mixed-teaser-slider.html.twig', {
  70.         'classNames': 'content-block--large',
  71.         'toptitle': ' ',
  72.         'title': 'news.detail.slider-title'|trans,
  73.         'isCardTeser': true,
  74.         'teasers': newsList|default([]),
  75.         'editmode': false
  76.     }, with_context = false) }}
  77. {% endblock %}
  78. {% block jld_root %}
  79.     {{ jld_root(news) }}
  80. {% endblock %}