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

Open in your IDE?
  1. {% sw_extends'@Storefront/storefront/element/cms-element-thumbnail-slider.html.twig' %}
  2. {% set isSlider = element.config.active.value %}
  3. {% block nd_cms_element_slider_container_slider_settings %}
  4.     {% if isSlider %}
  5.         {% set slick_settings_modal = {
  6.             "mobileFirst": true,
  7.             "arrows": true,
  8.             "prevArrow": "#prev-slide-"~element.id,
  9.             "nextArrow": "#next-slide-"~element.id,
  10.             "responsive": [
  11.                 {
  12.                     "breakpoint": 1,
  13.                     "settings": "unslick"
  14.                 },
  15.                 {
  16.                     "breakpoint": 1023,
  17.                     "settings": {
  18.                     "dots": false,
  19.                     "arrows": true,
  20.                     "infinite": false,
  21.                     "slidesToShow": 4,
  22.                 }
  23.                 }
  24.             ]
  25.         } %}
  26.     {% endif %}
  27.     <section class="hero-carousel mb-5 md:mb-10">
  28.         <div class="page-max-width">
  29.             <div class="wrapper relative">
  30.                 <div class="w-full text-center mb-4 md:mb-10">
  31.                     <h1>{{ element.config.title.value }}</h1>
  32.                 </div>
  33.                 <div class="{% if isSlider %} slick-thumbnail slick-init slick-after-lg slick-swipe-mobile slick-padding-boxed-layout {% else %} flex flex-col md:flex-row space-y-6 md:space-y-0 space-x-0 md:space-x-6 justify-center {% endif %}"
  34.                      data-slick='{{ slick_settings_modal|json_encode }}'>
  35.                     {% for key, slide in element.data.get('slides') %}
  36.                         <div class="w-auto h-auto">
  37.                             <div class="{% if isSlider %}relative w-56 h-56 mx-auto md:mx-auto lg:mx-auto xl:mx-4 xl:w-auto xl:h-auto {% else %} w-full h-72 mx-auto xl:w-72 xl:h-72 2xl:w-full 2xl:h-auto {% endif %}">
  38.                                 {% if slide.url %}
  39.                                 <a href="{{ slide.url }}">
  40.                                     {% endif %}
  41.                                 {# CHECK if desktop image exists, use two square blocks if it exists. If not, use a single 16x9 image #}
  42.                                 {% if slide.mobile_image %}
  43.                                     {% sw_thumbnails 'cms-image-thumbnails' with {
  44.                                         media: slide.mobile_image,
  45.                                         load: true,
  46.                                         attributes: {
  47.                                             'class': 'w-full h-full object-cover',
  48.                                             'alt': (slide.mobile_image.translated.alt ?: ''),
  49.                                             'title': (slide.mobile_image.translated.title ?: '')
  50.                                         }
  51.                                     } %}
  52.                                 {% endif %}
  53.                                 <div class="container relative text-black z-10 text-center">
  54.                                         {% if slide.text %}
  55.                                             <div class="hidden cursor-pointer w-full max-w-[80%] py-2 px-6 uppercase md:block btn-outline absolute bottom-6 left-1/2 transform -translate-x-1/2 flex items-center font-bold break-all">
  56.                                                 {{ slide.text }}
  57.                                             </div>
  58.                                         {% endif %}
  59.                                         {% if slide.mobileText %}
  60.                                             <div class="md:hidden cursor-pointer block w-full max-w-[80%] py-2 px-6 uppercase btn-outline absolute bottom-2 left-1/2 transform -translate-x-1/2 flex justify-center items-center font-bold break-all">
  61.                                                 {{ slide.mobileText }}
  62.                                             </div>
  63.                                         {% endif %}
  64.                                 </div>
  65.                                     {% if slide.url %}
  66.                                 </a>
  67.                                 {% endif %}
  68.                             </div>
  69.                         </div>
  70.                     {% endfor %}
  71.                 </div>
  72.             </div>
  73.         </div>
  74.     </section>
  75. {% endblock %}
  76. {% block nd_cms_element_slider_container_buttons %}
  77.     {% if isSlider %}
  78.         <div class="h-full hidden md:block">
  79.             {% block  nd_cms_element_slider_container_buttons_prev %}
  80.                 <button id="prev-slide-{{ element.id }}"
  81.                         class="products-back shadow-lg bg-white p-2 2xl:p-3 absolute -left-1 lg:-left-2 top-1/2 transform -translate-y-1/2 flex flex-col items-center text-white">
  82.                     {% sw_icon 'icon-leading-left' style{ 'pack': 'theme-icons', 'class': 'stroke w-6 2xl:w-7 text-gray-900' } %}
  83.                 </button>
  84.             {% endblock %}
  85.             {% block  nd_cms_element_slider_container_buttons_next %}
  86.                 <button id="next-slide-{{ element.id }}"
  87.                         class="products-back shadow-lg bg-white p-2 2xl:p-3 absolute -right-1 lg:-right-2 top-1/2 transform -translate-y-1/2 flex flex-col items-center text-white">
  88.                     {% sw_icon 'icon-leading-right' style{ 'pack': 'theme-icons', 'class': 'stroke w-6 2xl:w-7 text-gray-900' } %}
  89.                 </button>
  90.             {% endblock %}
  91.         </div>
  92.     {% endif %}
  93. {% endblock %}