templates/Tour/detail/tourGallery.html.twig line 1

Open in your IDE?
  1. <section class=" content-block js-fade-in">
  2.     <div class="container-sm container">
  3.         {{ include('Includes/title-block.html.twig', {
  4.             title: 'tour-detail.Gallery'|trans,
  5.             isCentered: true
  6.         }) }}
  7.     </div>
  8.     <div class="overflow-x-hidden">
  9.         <div class="container-sm container">
  10.             <div class="js-render-template" style="min-height: 1px;">
  11.                 <template class="js-render-template__template">
  12.                     <div class="js-lightbox js-gallery gallery">
  13.                         <div class="swiper-container js-gallery__slider gallery__container">
  14.                             <div class="swiper-wrapper gallery__wrapper">
  15.                                 {% for image in tour.images %}
  16.                                     {% set imageAlt = tour.category[0].name ~ ' ' ~ tour.name ~ ' - Touren-Impression #2.' ~ loop.index %}
  17.                                     {% if image.metadata is iterable %}
  18.                                         {% for metadata in heroImage.metadata %}
  19.                                             {% if metadata['name'] == 'alt' %}
  20.                                                 {% set imageAlt = metadata['data'] %}
  21.                                             {% endif %}
  22.                                         {% endfor %}
  23.                                     {% endif %}
  24.                                     <div class="swiper-slide gallery-swiper-slide">
  25.                                         <div class="gallery-item">
  26.                                             <div class="gallery-item__counter">
  27.                                                 <span class="text-primary">{{ loop.index }}</span>/{{ tour.images|length }}
  28.                                             </div>
  29.                                             <a href="{{ image.getThumbnail('lightbox') }}" class="gallery-item__img-wrapper js-lightbox__item embed-responsive-16by9 embed-responsive" data-sub-html="image description">
  30.                                                 {{ image.thumbnail('gallery-item').html({
  31.                                                     imgAttributes: {
  32.                                                         class: 'js-lazy-img embed-responsive-item'
  33.                                                     },
  34.                                                     alt: imageAlt,
  35.                                                     lowQualityPlaceholder: true,
  36.                                                 }) | raw }}
  37.                                             </a>
  38.                                             {% set description = getImageDescription(image) %}
  39.                                             {% if description %}
  40.                                                 <div class="gallery-item__text">
  41.                                                     {{ description }}
  42.                                                 </div>
  43.                                             {% endif %}
  44.                                         </div>
  45.                                     </div>
  46.                                 {% endfor %}
  47.                             </div>
  48.                             <div class="swiper-navigation gallery__swiper-navigation">
  49.                                 <button class="swiper-button swiper-button--prev gallery__btn js-gallery__prev"><span class="icon icon-arrow-right" aria-label="Previous"></span></button>
  50.                                 <button class="swiper-button swiper-button--next gallery__btn js-gallery__next"><span class="icon icon-arrow-right" aria-label="Next"></span></button>
  51.                             </div>
  52.                         </div>
  53.                     </div>
  54.                 </template>
  55.             </div>
  56.         </div>
  57.     </div>
  58. </section>