templates/news/item.html.twig line 1

  1. {% extends 'layout/base.html.twig' %}
  2. {% block title %}{{ title(item.caption, "title.news.caption"|trans) }}{% endblock %}
  3. {% block body %}
  4.     {# @var item  \App\Entity\Content\News #}
  5.     <div class="presentation new-presentation">
  6.         <div class="presentation__background-wrapper">
  7.             <div class="presentation__background  presentation__background-top"
  8.                  style="background-image: url({{ asset('build/images/header/bg.jpg') }})"></div>
  9. {#            <div class="presentation__background  {% if not item.image %}presentation__background-top{% endif %}"
  10.                  style="background-image: url({% if item.image %}
  11.                      {{ vich_uploader_asset(item.image)|imagine_filter('news_item_background') }}
  12.                  {% else %}{{ asset('build/images/header/bg.jpg') }}{% endif %})"></div>#}
  13.             {# <div class="presentation__background"                 style="background-image: url({{ asset('build/images/news/6.jpg') }})"></div> #}
  14.         </div>
  15.         <div class="presentation__content container">
  16.             <h1 class="presentation__title presentation__title_size_s">{{ item.caption }}</h1>
  17.             {% if item.subtitle %}
  18.                 <div class="presentation__subtitle">{{ item.subtitle }}</div>
  19.             {% endif %}
  20.         </div>
  21.         <div class="new-presentation__info">
  22.             <div class="new-presentation__info-inner container">
  23.                 {{ item|owner_render('news_view') }}
  24.                 <div class="new-presentation__date">{{ item.publishAt|format_date('long',"dd MMMM yyyy") }}</div>
  25.             </div>
  26.         </div>
  27.     </div>
  28.     <div class="new">
  29.         <div class="new__inner container">
  30.             <div class="text-block new__content">
  31.                 {{ item.text|raw }}
  32.             </div>
  33.             {% if other_news %}
  34.                 <div class="new__other-news">
  35.                     <h4 class="new__other-news-title">{{ "news.other_news"|trans }}</h4>
  36.                     <div class="new__other-news-inner">
  37.                         {% for n in other_news %}
  38.                             <div class="new__other-news-new">
  39.                                 {% if n.image %}<a class="new__other-news-new-image image-cover"
  40.                                                    href="{{ path('news_item',{id:n.id}) }}">
  41.                                     <img
  42.                                             src="{{ vich_uploader_asset(n.image)|imagine_filter('news_other_preview') }}"
  43.                                     >
  44.                                     </a>
  45.                                 {% endif %}
  46.                                 <div class="new__other-news-new-text"><a class="new__other-news-new-title"
  47.                                                                          href="{{ path('news_item',{id:n.id}) }}">
  48.                                         <h5>{{ n.caption }}</h5></a>
  49.                                     <div class="new__other-news-new-date">{{ n.publishAt|format_date('long',"dd MMMM yyyy") }}</div>
  50.                                 </div>
  51.                             </div>
  52.                         {% endfor %}
  53.                     </div>
  54.                 </div>
  55.             {% endif %}
  56.         </div>
  57.     </div>
  58. {% endblock %}