templates/Includes/Teaser/img-teaser.html.twig line 1

Open in your IDE?
  1. {# hasShadow should not be used for sliders! #}
  2. <section class="img-teaser {{ ratio|default('') == "square" ? 'img-teaser-square' : '' }} {{ isSearchTeaser| default(false) ? 'img-teaser--search': '' }} stretch-link teaser-animation {{ hasShadow | default(null) ? 'img-teaser--has-shadow' : '' }} {{ styleModifier | default(null) }}">
  3.     {#
  4.     img-teaser-square are used for regions in region-overlay
  5.     #}
  6.     <div class="{{ ratio|default('') == "square" or isInNav|default(null) or ratio|default('') == "square-big" ? 'embed-responsive-1by1' : 'img-teaser__embed ' }} embed-responsive">
  7.         {% set thumb = ratio ? 'img-teaser-' ~ ratio : 'img-teaser' %}
  8.         {% if not isAdditionalLink | default(false) %}
  9.             {% set description = getImageDescription(image, true) %}
  10.             {{ image|default(null) ? image.thumbnail(isInNav|default(null) ? 'img-teaser--nav' : thumb ).html({
  11.                 imgAttributes: {
  12.                     class: 'js-lazy-img embed-responsive-item teaser-animation__img'
  13.                 },
  14.                 lowQualityPlaceholder: true,
  15.                 title: description|default(''),
  16.                 alt: description|default('')
  17.             }) |raw : '' }}
  18.         {% else %}
  19.             <div class="embed-responsive-item teaser-animation__img bg-primary-light"></div>
  20.         {% endif %}
  21.         {% do jsConfig().add('lazyImg', true) %}
  22.     </div>
  23.     <div class="img-teaser__content">
  24.         <div>
  25.             {% if badgeText|default('') %}
  26.                 <div class="img-teaser__badge {{ badgeWhite | default(false) ? 'img-teaser__badge--white' : '' }}">
  27.                     {{ badgeText|default('') }}
  28.                 </div>
  29.             {% endif %}
  30.             <{{ isInNav|default(null) ? 'div' : 'h3' }} class="img-teaser__title h5">
  31.             {% set description = getImageDescription(image) %}
  32.             <a href="{{ href }}" class="stretch-link__link" title="{{ description|default('') }}">
  33.                 {{ title|default('') }}
  34.             </a>
  35.             </{{ isInNav|default(null) ? 'div' : 'h3' }}>
  36.         {% if text | default(false) %}
  37.             <div class="img-teaser__text">
  38.                 {{ text }}
  39.             </div>
  40.         {% elseif buttonText | default(false) %}
  41.             <a href="{{ href }}" class="btn btn-white btn-block mt-2">
  42.                 {{ buttonText | default("") }}
  43.             </a>
  44.         {% endif %}
  45.         </div>
  46.     </div>
  47. </section>