custom/static-plugins/NdTheme/src/Resources/views/storefront/element/cms-element-product-slider.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/element/cms-element-product-slider.html.twig' %}
  2. {% block element_product_slider %}
  3.     {% if not sliderConfig %}
  4.         {% set sliderConfig = element.fieldConfig.elements %}
  5.     {% endif %}
  6.     {% set gallerySliderOptions = {
  7.         "mobileFirst": true,
  8.         "variableWidth": true,
  9.         "responsive": [
  10.             {
  11.                 "breakpoint": 1,
  12.                 "settings": "unslick"
  13.             },
  14.             {
  15.                 "breakpoint": 1023,
  16.                 "settings": {
  17.                 "dots": false,
  18.                 "arrows": false,
  19.                 "infinite": false,
  20.                 "slidesToShow": 4,
  21.             }
  22.             }
  23.         ]
  24.     } %}
  25.     {% if sliderConfig.navigation.value %}
  26.         {% set gallerySliderOptions = gallerySliderOptions|replace_recursive({
  27.             "arrows": true,
  28.             "prevArrow": "#prev-slide-"~element.id,
  29.             "nextArrow": "#next-slide-"~element.id,
  30.         }) %}
  31.     {% endif %}
  32.     {% if element.data.products.elements %}
  33.         <div class="cms-element-{{ element.type }}{% if sliderConfig.displayMode.value == "standard" and sliderConfig.verticalAlign.value %} has-vertical-alignment{% endif %}">
  34.             {% block element_product_slider_alignment %}
  35.                 {% block element_product_slider_slider %}
  36.                     <div class="product-slider{% if sliderConfig.navigation.value %} has-nav{% endif %}">
  37.                         {% block element_product_slider_title %}
  38.                             {% if sliderConfig.title.value %}
  39.                                 <div class="product-slider-title boxed-layout h2 mb-3">
  40.                                     {{ sliderConfig.title.value }}
  41.                                 </div>
  42.                             {% endif %}
  43.                         {% endblock %}
  44.                         {% block element_product_slider_controls %}
  45.                             {% if sliderConfig.navigation.value %}
  46.                                 <div class="custom-slick-control flex grid-gap-2 justify-end hidden lg:flex boxed-layout">
  47.                                     <button id="prev-slide-{{ element.id }}"
  48.                                             class="products-back flex p-1 transition duration-300 active:-translate-x-0.5 hover:-translate-x-0.5">
  49.                                         {% sw_icon 'arrow-head-left' %}
  50.                                     </button>
  51.                                     <button id="next-slide-{{ element.id }}"
  52.                                             class="products-next flex p-1 transition duration-300 active:translate-x-0.5 hover:translate-x-0.5">
  53.                                         {% sw_icon 'arrow-head-right' %}
  54.                                     </button>
  55.                                 </div>
  56.                             {% endif %}
  57.                         {% endblock %}
  58.                         {% block element_product_slider_inner %}
  59.                             {% block element_product_slider_element %}
  60.                                 <div class="product-slider-container slick-init slick-after-lg slick-swipe-mobile slick-padding-boxed-layout"
  61.                                      data-slick='{{ gallerySliderOptions|json_encode }}'>
  62.                                     {% for product in element.data.products.elements %}
  63.                                         {% block element_product_slider_inner_item %}
  64.                                             <div class="product-slider-item !w-[232px] md:!w-[264px] mr-2">
  65.                                                 {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  66.                                                     'layout': sliderConfig.boxLayout.value,
  67.                                                     'displayMode': sliderConfig.displayMode.value
  68.                                                 } %}
  69.                                             </div>
  70.                                         {% endblock %}
  71.                                     {% endfor %}
  72.                                     <div class="product-slider-item">
  73.                                     </div>
  74.                                     <div class="product-slider-item">
  75.                                     </div>
  76.                                 </div>
  77.                             {% endblock %}
  78.                         {% endblock %}
  79.                     </div>
  80.                 {% endblock %}
  81.             {% endblock %}
  82.         </div>
  83.     {% endif %}
  84. {% endblock %}