<div class="js-gallery gallery {{ styleModifier | default(null) }}">
{% set itemCounter = images|length %}
<div class="swiper-container js-gallery__slider gallery__container">
<div class="swiper-wrapper gallery__wrapper">
{% for item in images %}
{# check if no empty gallery item exists, counter will not be changed. Has to be maintained correctly! #}
{% if item %}
<div class="swiper-slide gallery-swiper-slide">
<div class="gallery-item">
<div class="gallery-item__counter">
<span class="text-primary">{{ loop.index }}</span>/
{{ itemCounter }}
</div>
{% if item is instanceof('\\Pimcore\\Model\\DataObject\\Data\\Hotspotimage') %}
{% set item = item.image %}
{% endif %}
<div class="embed-responsive-16by9 embed-responsive gallery-item__img-wrapper">
{% set description = getImageDescription(item, true) %}
{% set alt = headline ~ ' - Impression #2.' ~ loop.index %}
{% for metadata in item.metadata %}
{% if metadata['name'] == 'alt' and metadata['language'] == 'de' %}
{% set alt = metadata['data'] %}
{% endif %}
{% endfor %}
{{ item.getThumbnail('gallery-item').getHtml({
imgAttributes: {
class: 'js-lazy-img embed-responsive-item'
},
lowQualityPlaceholder: true,
title: description|default(''),
alt: alt
})|raw }}
</div>
{% set description = getImageDescription(item) %}
{% if description %}
<div class="gallery-item__text">
{{ description }}
</div>
{% endif %}
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
<div class="swiper-navigation gallery__swiper-navigation">
<button class="swiper-button swiper-button--prev gallery__btn js-gallery__prev"><span class="icon icon-arrow-right" aria-label="Previous"></span></button>
<button class="swiper-button swiper-button--next gallery__btn js-gallery__next"><span class="icon icon-arrow-right" aria-label="Next"></span></button>
</div>
</div>