templates/areas/media-gallery/view.html.twig line 1

Open in your IDE?
  1. <section class="content-block js-fade-in {{ include('Layout/includes/editmode-box-classes.html.twig') }} {{ styleModifier | default(null) }} {{ not pimcore_input('anchorTitle').empty ? 'js-anchor-nav__item' : '' }}" {% if not pimcore_input('anchorTitle').empty %}data-anchor-nav-title="{{ pimcore_input('anchorTitle').frontend }}"{% endif %}>
  2.     {% embed 'Includes/editmode-settings.html.twig' %}
  3.         {% block additionalInfo %}
  4.             <div>
  5.                 <label>
  6.                     {{ pimcore_checkbox('titleBlockCentered') }} Center Headline?
  7.                 </label>
  8.             </div>
  9.             <div>
  10.                 <label>
  11.                     Images
  12.                     {{ pimcore_relations('gallery', {'types': ['asset'], 'subtyps': ['image']}) }}
  13.                 </label>
  14.             </div>
  15.         {% endblock %}
  16.     {% endembed %}
  17.     <div class="container-sm container">
  18.         {{ include('Includes/title-block-editable.html.twig') }}
  19.     </div>
  20.     <div class="overflow-x-hidden ">
  21.         <div class="container-sm container">
  22.             <div class="js-render-template" style="min-height: 1px;">
  23.                 <template class="js-render-template__template">
  24.                     <div class="js-gallery gallery">
  25.                         <div class="swiper-container js-gallery__slider gallery__container">
  26.                             <div class="swiper-wrapper gallery__wrapper">
  27.                                 {% for image in pimcore_relations('gallery').elements %}
  28.                                     <div class="swiper-slide gallery-swiper-slide">
  29.                                         <div class="gallery-item">
  30.                                             <div class="gallery-item__counter">
  31.                                                 <span class="text-primary">{{ loop.index }}</span>/{{ pimcore_relations('gallery').elements|length }}
  32.                                             </div>
  33.                                             <div class="embed-responsive-16by9 embed-responsive gallery-item__img-wrapper">
  34.                                                 {% set description = getImageDescription(image, true) %}
  35.                                                 {% set title = description %}
  36.                                                 {% set alt = description %}
  37.                                                 {{ image.thumbnail('gallery-item').html({
  38.                                                     imgAttributes: {
  39.                                                         class: 'js-lazy-img embed-responsive-item',
  40.                                                         title: title,
  41.                                                         alt: alt
  42.                                                     },
  43.                                                     lowQualityPlaceholder: true
  44.                                                 }) | raw }}
  45.                                             </div>
  46.                                             {% set description = getImageDescription(image) %}
  47.                                             {% if description %}
  48.                                                 <div class="gallery-item__text">
  49.                                                     {{ description }}
  50.                                                 </div>
  51.                                             {% endif %}
  52.                                         </div>
  53.                                     </div>
  54.                                 {% endfor %}
  55.                             </div>
  56.                             <div class="swiper-navigation gallery__swiper-navigation">
  57.                                 <button class="swiper-button swiper-button--prev gallery__btn js-gallery__prev"><span class="icon icon-arrow-right" aria-label="Previous"></span></button>
  58.                                 <button class="swiper-button swiper-button--next gallery__btn js-gallery__next"><span class="icon icon-arrow-right" aria-label="Next"></span></button>
  59.                             </div>
  60.                         </div>
  61.                     </div>
  62.                 </template>
  63.             </div>
  64.         </div>
  65.     </div>
  66. </section>