templates/Magazine/Includes/heroDetail.html.twig line 1

Open in your IDE?
  1. {% do jsConfig().add('lazyImg', true) %}
  2. {% set badge = article.topArticle ? (article.getAdvertismentNote() ?: ("magazine.top-article.badge")|trans) : false %}
  3. <div class="hero-magazine content-block {{ styleModifier | default(null) }}">
  4.     <figure class="hero-magazine__image embed-responsive hero-magazine__embed--full-width">
  5.         {% if article.teaserImage %}
  6.             {% set description = getImageDescription(article.teaserImage) %}
  7.             {{ article.teaserImage.thumbnail('hero-magazine--full-width').html({
  8.                 imgAttributes: {
  9.                     class: 'embed-responsive-item'
  10.                 },
  11.                 lowQualityPlaceholder: true,
  12.                 title: description,
  13.                 alt: description,
  14.             })|raw }}
  15.             {{ article.teaserImage.thumbnail('hero-magazine--full-width').html({
  16.                 imgAttributes: {
  17.                     class: 'embed-responsive-item'
  18.                 },
  19.                 title: description,
  20.                 alt: description
  21.             })|raw }}
  22.         {% endif %}
  23.     </figure>
  24.     <div class="hero-magazine__content-wrapper {{ badge ? 'hero-magazine__content-wrapper--has-badge' : '' }} ">
  25.             {% if badge %}
  26.                 {{ include('Magazine/Includes/triangle-badge.html.twig', {
  27.                     'text': badge,
  28.                     'position': 'right',
  29.                     'styleModifier': ''
  30.                 }) }}
  31.             {% endif %}
  32.             <div class="hero-magazine__content">
  33.                 {% if article.getCategories() and article.getCategories()[0] %}
  34.                     {% set articleTheme = getThemeByCategoryId(article.getCategories()[0].id) %}
  35.                     {% if articleTheme %}
  36.                         <div class="hero-magazine__top-headline">
  37.                             {{ articleTheme.name }}
  38.                         </div>
  39.                     {% endif %}
  40.                 {% endif %}
  41.                 <h1 class="js-toc__title hero-magazine__title">
  42.                     {{ article.title }}
  43.                 </h1>
  44.                 {% if article.articleDate or article.readingTime or article.categories is not empty %}
  45.                     <div class="hero-magazine__info-wrapper">
  46.                         {% if article.articleDate %}
  47.                             <time datetime="{{ article.articleDate | date('Y-m-d') }}" class="hero-magazine__date">
  48.                                 {{ article.articleDate | date('d.m.Y') }}
  49.                             </time>
  50.                         {% endif %}
  51.                         {% if article.readingTime or article.categories is not empty %}
  52.                             <ul class="hero-magazine__additional-infos list-inline">
  53.                                 {% if article.readingTime %}
  54.                                     <li class="hero-magazine__additional-infos__item list-inline-item">
  55.                                         <span class="icon icon-clock" aria-label="{{ 'sr.Lesezeit'|trans }}" title="{{ 'sr.Lesezeit'|trans }}"></span>
  56.                                         {{ article.readingTime }} {{ 'magazine.Minuten Lesezeit' | trans }}
  57.                                     </li>
  58.                                 {% endif %}
  59.                                 {% if article.categories is not empty %}
  60.                                     <li class="hero-magazine__additional-infos__item list-inline-item">
  61.                                         <span class="icon icon-tag" aria-label="{{ 'sr.Kategorie'|trans }}" title="{{ 'sr.Kategorie'|trans }}"></span>
  62.                                         {% for category in article.categories %}
  63.                                             {{ category.name }}{% if not loop.last %}, {% endif %}
  64.                                         {% endfor %}
  65.                                     </li>
  66.                                 {% endif %}
  67.                             </ul>
  68.                         {% endif %}
  69.                     </div>
  70.                 {% endif %}
  71.                 {% if article.author %}
  72.                     <div class="row row--gutter-width-10 hero-magazine__author">
  73.                         <div class="col-auto">
  74.                             <div class="embed-responsive embed-responsive-1by1 hero-magazine__author-img-wrapper">
  75.                                 {% if article.author.image %}
  76.                                     {{ article.author.image.thumbnail('hero-magazine__author').html({
  77.                                         imgAttributes: {
  78.                                             class: 'embed-responsive-item js-lazy-img'
  79.                                         },
  80.                                         lowQualityPlaceholder: true,
  81.                                     })|raw }}
  82.                                 {% endif %}
  83.                             </div>
  84.                         </div>
  85.                         <div class="col d-flex align-items-center">
  86.                             <a href="{{ linkGenerator().generate(article.author) }}" class="hero-magazine__author-title">
  87.                                 {{ ('magazine.author.' ~ article.author.gender) | trans }}: {{ article.author.name }}
  88.                             </a>
  89.                         </div>
  90.                     </div>
  91.                 {% endif %}
  92.             </div>
  93.         </div>
  94. </div>