templates/Includes/Partials/gallery.html.twig line 1

Open in your IDE?
  1. <div class="js-gallery gallery {{ styleModifier | default(null) }}">
  2.     {% set itemCounter = images|length %}
  3.     <div class="swiper-container js-gallery__slider gallery__container">
  4.         <div class="swiper-wrapper gallery__wrapper">
  5.             {% for item in images %}
  6. {#                check if no empty gallery item exists, counter will not be changed. Has to be maintained correctly! #}
  7.                 {% if item %}
  8.                     <div class="swiper-slide gallery-swiper-slide">
  9.                         <div class="gallery-item">
  10.                             <div class="gallery-item__counter">
  11.                                 <span class="text-primary">{{ loop.index }}</span>/
  12.                                 {{ itemCounter }}
  13.                             </div>
  14.                             {% if item is instanceof('\\Pimcore\\Model\\DataObject\\Data\\Hotspotimage') %}
  15.                                 {% set item = item.image %}
  16.                             {% endif %}
  17.                             <div class="embed-responsive-16by9 embed-responsive gallery-item__img-wrapper">
  18.                                 {% set description = getImageDescription(item, true) %}
  19.                                 {% set alt = headline ~ ' - Impression #2.' ~ loop.index %}
  20.                                 {% for metadata in item.metadata %}
  21.                                     {% if metadata['name'] == 'alt' and metadata['language'] == 'de' %}
  22.                                         {% set alt = metadata['data'] %}
  23.                                     {% endif %}
  24.                                 {% endfor %}
  25.                                 {{ item.getThumbnail('gallery-item').getHtml({
  26.                                     imgAttributes: {
  27.                                         class: 'js-lazy-img embed-responsive-item'
  28.                                     },
  29.                                     lowQualityPlaceholder: true,
  30.                                     title: description|default(''),
  31.                                     alt: alt
  32.                                 })|raw }}
  33.                             </div>
  34.                             {% set description = getImageDescription(item) %}
  35.                             {% if description %}
  36.                                 <div class="gallery-item__text">
  37.                                     {{ description }}
  38.                                 </div>
  39.                             {% endif %}
  40.                         </div>
  41.                     </div>
  42.                 {% endif %}
  43.             {% endfor %}
  44.         </div>
  45.     </div>
  46.     <div class="swiper-navigation gallery__swiper-navigation">
  47.         <button class="swiper-button swiper-button--prev gallery__btn js-gallery__prev"><span class="icon icon-arrow-right" aria-label="Previous"></span></button>
  48.         <button class="swiper-button swiper-button--next gallery__btn js-gallery__next"><span class="icon icon-arrow-right" aria-label="Next"></span></button>
  49.     </div>
  50. </div>