{% do jsConfig().add( 'slider', true) %}
<section class="demi-infrastructure-detail-content-block demi-infrastructure-detail-content-block--gallery">
<div class="container-sm container">
<div class="js-gallery gallery">
<div class="swiper-container js-gallery__slider gallery__container">
<div class="swiper-wrapper gallery__wrapper">
{% set ogImageCount = 0 %}
{% set thumb = 'demi-infrastructure-event-detail-gallery' %}
{% set slides = detailSlides[1:] %}
{% if detailSlides[0] is defined %}
{% set slides = slides|merge([detailSlides[0]]) %}
{% endif %}
{% for item in slides %}
{% if ogImageCount < 5 %}
{% set ogImageCount = ogImageCount + 1 %}
{% do elements_opengraph().addImage(item.getDocument().getThumbnail('slider-main' ).getPath()) %}
{% endif %}
{% set copyright = '' %}
{% set image = item %}
{% if item is instanceof("\\Elements\\Demi\\Model\\DocumentImage") %}
{% set image = item.getDocument() %}
{% set copyright = demi_getNameAndCopyrightForImage(image) %}
{% elseif item is instanceof("\\Pimcore\\Model\\Asset\\Image") or image is defined and image is instanceof("\\Pimcore\\Model\\DataObject\\DocumentImage") %}
{% set copyright = demi_eventGetImageMeta(image) %}
{% else %}
{% set copyright = demi_eventGetImageMeta(image.getDocument()) %}
{% endif %}
{% set imageAlt = headline ~ ' - Impression #2.' ~ loop.index %}
{% for metadata in image.metadata %}
{% if metadata['name'] == 'alt' and metadata['language'] == 'de' %}
{% set imageAlt = metadata['data'] %}
{% endif %}
{% endfor %}
{% set imageTexts = getImageTexts(image) %}
{# Add second method call for getImageTexts to avoid double copyright #}
<div class="swiper-slide gallery-swiper-slide">
<figure class="embed-responsive embed-responsive-16by9">
{{ image.getThumbnail(thumb).getHTML({'imgAttributes': {
'class' : 'embed-responsive-item js-lazy-img',
'title' : demi_parseImageTexts(getImageTexts(image, true), true),
'alt' : imageAlt,
'lowQualityPlaceholder' : true
}}) | raw }}
</figure>
{% if imageTexts.copyright|default(false) or imageTexts.author|default(false) %}
<div class="text-priamry my-3">
{% if imageTexts.copyright|default(false) %}
{{ imageTexts.copyright }}
{% endif %}
{% if imageTexts.copyright|default(false) and imageTexts.author|default(false) %}
|
{% endif %}
{% if imageTexts.author|default(false) %}
{{ imageTexts.author }}
{% endif %}
</div>
{% endif %}
</div>
{% 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>
</div>
</section>