custom/plugins/ATNTheme/src/Resources/views/storefront/element/cms-element-image-gallery.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/element/cms-element-image-gallery.html.twig' %}
  2. {% block element_image_gallery_inner_col %}
  3.     <div class="gallery-slider-col{% if galleryPosition == "left" %} col order-1 order-md-2{% elseif galleryPosition == "underneath" %} col-12 order-1{% endif %}"
  4.          {% if zoomModal %}data-zoom-modal="true"{% endif %}>
  5.         <div class="product-slider-info">{{ "detail.productInfo"|trans|sw_sanitize }}</div>
  6.         {# option "magnifierOverGallery" shows zoom container over gallery #}
  7.         <div class="base-slider gallery-slider{% if navigationArrows == "outside" %} has-nav-outside{% endif %}{% if navigationDots == "outside" %} has-dots-outside{% endif %}{% if magnifierOverGallery %} js-magnifier-zoom-image-container{% endif %}">
  8.             {% block element_image_gallery_inner_wrapper %}
  9.                 {% if imageCount > 1 %}
  10.                     {% block element_image_gallery_inner_multiple_slides %}
  11.                         {% block element_image_gallery_inner_container %}
  12.                             <div class="gallery-slider-container"
  13.                                  data-gallery-slider-container="true">
  14.                                 {% block element_image_gallery_inner_items %}
  15.                                     {% for image in mediaItems %}
  16.                                         {% block element_image_gallery_inner_item %}
  17.                                             <div class="gallery-slider-item-container">
  18.                                                 <div class="gallery-slider-item is-{{ displayMode }} js-magnifier-container"{% if minHeight and  (displayMode == "cover" or displayMode == "contain" ) %} style="min-height: {{ minHeight }}"{% endif %}>
  19.                                                     {% set attributes = {
  20.                                                         'class': 'img-fluid gallery-slider-image magnifier-image js-magnifier-image',
  21.                                                         'alt': (image.translated.alt ?: fallbackImageTitle),
  22.                                                         'title': (image.translated.title ?: fallbackImageTitle),
  23.                                                         'data-full-image': image.url
  24.                                                     } %}
  25.                                                     {% if displayMode == 'cover' or displayMode == 'contain' %}
  26.                                                         {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  27.                                                     {% endif %}
  28.                                                     {% if isProduct %}
  29.                                                         {% set attributes = attributes|merge({ 'itemprop': 'image' }) %}
  30.                                                     {% endif %}
  31.                                                     {% sw_thumbnails 'gallery-slider-image-thumbnails' with {
  32.                                                         media: image
  33.                                                     } %}
  34.                                                 </div>
  35.                                             </div>
  36.                                         {% endblock %}
  37.                                     {% endfor %}
  38.                                 {% endblock %}
  39.                             </div>
  40.                         {% endblock %}
  41.                         {% block element_image_gallery_inner_controls %}
  42.                             {% if navigationArrows %}
  43.                                 <div class="gallery-slider-controls"
  44.                                      data-gallery-slider-controls="{% if navigationArrows %}true{% else %}false{% endif %}">
  45.                                     {% block element_image_gallery_inner_control_items %}
  46.                                         {% block element_image_gallery_inner_control_prev %}
  47.                                             <button class="base-slider-controls-prev gallery-slider-controls-prev{% if navigationArrows == "outside" %} is-nav-prev-outside{% elseif navigationArrows == "inside" %} is-nav-prev-inside{% endif %}"
  48.                                                     aria-label="{{ 'general.previous'|trans|striptags }}">
  49.                                                 {% block element_image_gallery_inner_control_prev_icon %}
  50.                                                     {% sw_icon 'arrow-head-left' %}
  51.                                                 {% endblock %}
  52.                                             </button>
  53.                                         {% endblock %}
  54.                                         {% block element_image_gallery_inner_control_next %}
  55.                                             <button class="base-slider-controls-next gallery-slider-controls-next{% if navigationArrows == "outside" %} is-nav-next-outside{% elseif navigationArrows == "inside" %} is-nav-next-inside{% endif %}"
  56.                                                     aria-label="{{ 'general.next'|trans|striptags }}">
  57.                                                 {% block element_image_gallery_inner_control_next_icon %}
  58.                                                     {% sw_icon 'arrow-head-right' %}
  59.                                                 {% endblock %}
  60.                                             </button>
  61.                                         {% endblock %}
  62.                                     {% endblock %}
  63.                                 </div>
  64.                             {% endif %}
  65.                         {% endblock %}
  66.                     {% endblock %}
  67.                 {% else %}
  68.                     {% block element_image_gallery_inner_single %}
  69.                         <div class="gallery-slider-single-image is-{{ displayMode }} js-magnifier-container"{% if minHeight %} style="min-height: {{ minHeight }}"{% endif %}>
  70.                             {% if imageCount > 0 %}
  71.                                 {% set attributes = {
  72.                                     'class': 'img-fluid gallery-slider-image magnifier-image js-magnifier-image',
  73.                                     'alt': (mediaItems|first.translated.alt ?: fallbackImageTitle),
  74.                                     'title': (mediaItems|first.translated.title ?: fallbackImageTitle),
  75.                                     'data-full-image': mediaItems|first.url
  76.                                 } %}
  77.                                 {% if displayMode == 'cover' or displayMode == 'contain' %}
  78.                                     {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  79.                                 {% endif %}
  80.                                 {% if isProduct %}
  81.                                     {% set attributes = attributes|merge({ 'itemprop': 'image' }) %}
  82.                                 {% endif %}
  83.                                 {% sw_thumbnails 'gallery-slider-image-thumbnails' with {
  84.                                     media: mediaItems|first,
  85.                                 } %}
  86.                             {% else %}
  87.                                 {% sw_icon 'placeholder' style {
  88.                                     'size': 'fluid'
  89.                                 } %}
  90.                             {% endif %}
  91.                         </div>
  92.                     {% endblock %}
  93.                 {% endif %}
  94.             {% endblock %}
  95.             {% block element_image_gallery_slider_dots %}
  96.                 {% if imageCount > 1 and navigationDots %}
  97.                     <div class="base-slider-dots {% if imageCount > maxItemsToShowNav %} hide-dots{% elseif imageCount > maxItemsToShowMobileNav %} hide-dots-mobile{% endif %}">
  98.                         {% block element_image_gallery_slider_dots_buttons %}
  99.                             {% for image in mediaItems %}
  100.                                 {% block element_image_gallery_slider_dots_button %}
  101.                                     <button class="base-slider-dot"
  102.                                             data-nav-dot="{{ loop.index }}"
  103.                                             tabindex="-1"></button>
  104.                                 {% endblock %}
  105.                             {% endfor %}
  106.                         {% endblock %}
  107.                     </div>
  108.                 {% endif %}
  109.             {% endblock %}
  110.         </div>
  111.     </div>
  112. {% endblock %}