templates/includes/teaser/image-teaser.html.twig line 1

Open in your IDE?
  1. {% set styleModifier = styleModifier | default('') %}
  2. {% set textOnly = textOnly|default(false) %}
  3. {% set cols = cols|default(1) %}
  4. {% set event = event ?? null %}
  5. <div class="image-teaser{{ textOnly ? ' image-teaser--text' : '' }}{{ cols == 1 ? '' : ' image-teaser--' ~ cols ~ 'col' }}{{ styleModifier ? ' ' ~ styleModifier : '' }} stretch-link" {{ editmode and textOnly ? 'style="height: 500px;"' : '' }}
  6.     {% if event %}
  7.     data-event-tracking-event="{{ event }}"
  8.     data-event-tracking-click_item="{{ title }}"
  9.     data-event-tracking-click_page_location="{{ href }}"
  10.     {% endif %}>
  11.     <div class="image-teaser__container">
  12.         {% if textOnly|default(false) %}
  13.             <div class="image-teaser__text">
  14.                 <a class="stretch-link__link" href="{{ href|default('#') }}">{{ title }}</a>
  15.                 {% if button|default(false) %}
  16.                     <div><a href="#" class="btn btn-primary mt-4">{{ button }}</a></div>
  17.                 {% endif %}
  18.             </div>
  19.             <div class="image-teaser__arrow" aria-hidden="true">
  20.                 <div class="icon icon-arrow" aria-hidden="true"></div>
  21.             </div>
  22.         {% else %}
  23.             {% if image|default(null) %}
  24.                 <div class="image-teaser__image ratio">
  25.                     {{ image.thumbnail('image-teaser' ~ (cols == 1 ? '' : '-' ~ cols ~ 'col')).html({
  26.                         imgAttributes:{
  27.                             class:'js-lazy-img ratio-item'
  28.                         },
  29.                         lowQualityPlaceholder:true
  30.                     })|raw }}
  31.                 </div>
  32.             {% endif %}
  33.             <div class="image-teaser__gradient"></div>
  34.             <div class="image-teaser__body">
  35.                 <div class="image-teaser__body-inner">
  36.                     {% if date|default(null) or author|default(null) %}
  37.                         <ul class="image-teaser__list">
  38.                             {% if date|default(null) %}<li>{{ date.formatLocalized('%d. %B %Y') }}</li>{% endif %}
  39.                             {% if author|default(null) %}<li>{{ author }}</li>{% endif %}
  40.                         </ul>
  41.                     {% endif %}
  42.                     <div class="image-teaser__supline">{{ suptitle|default('') }}</div>
  43.                     <{{ teaserTitleTag|default('h3') }} class="image-teaser__headline">
  44.                         <a class="stretch-link__link" href="{{ href|default('#') }}" target="{{ target|default("_self") }}">{{ title }}</a>
  45.                     </{{ teaserTitleTag|default('h3') }}>
  46.                 </div>
  47.             </div>
  48.         {% endif %}
  49.     </div>
  50. </div>