templates/news/detail.html.twig line 16

Open in your IDE?
  1. {# @var news \Pimcore\Model\DataObject\News #}
  2. {% extends 'layouts/layout.html.twig' %}
  3. {% block content %}
  4.     <div id="main-content" class="main-content mb-5">
  5.         <div class="page-header">
  6.             <h1>{{ news.title }}</h1>
  7.         </div>
  8.         <div class="text-muted mb-3">{{ news.date | date('Y-m-d h:i A') }}</div>
  9.         <div class="display-6">
  10.             {{ news.shortText }}
  11.         </div>
  12.         {% if news.gallery.items %}
  13.             <div class="row">
  14.                 {% for image in news.gallery.items %}
  15.                     {% if image.image %}
  16.                         <div class="col-sm-3 mt-3">
  17.                             <a href="{{ image.getThumbnail('galleryLightbox')|raw }}" class="thumbnail">
  18.                                 {{ image.thumbnail('galleryThumbnail').getHTML({imgAttributes: {class: 'img-thumbnail img-fluid w-100'}})|raw }}
  19.                             </a>
  20.                         </div>
  21.                     {% endif %}
  22.                 {% endfor %}
  23.             </div>
  24.         {% endif %}
  25.         {% if news.content %}
  26.             {% for item in news.content.items %}
  27.                 {% include 'news/content/' ~ item.type ~ '.html.twig' with {'item': item} %}
  28.             {% endfor %}
  29.         {% endif %}
  30.     </div>
  31. {% endblock %}