custom/plugins/DecomTheme/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.     {% if element.data.products.elements %}
  7.         <div
  8.             class="cms-element-{{ element.type }}{% if sliderConfig.displayMode.value == "standard" and sliderConfig.verticalAlign.value %} has-vertical-alignment{% endif %}">
  9.             {% block element_product_slider_alignment %}
  10.                 {% if config.verticalAlign.value %}
  11.                     <div class="cms-element-alignment{% if sliderConfig.verticalAlign.value == "center" %} align-self-center{% elseif sliderConfig.verticalAlign.value == "flex-end" %} align-self-end{% else %} align-self-start{% endif %}">
  12.                 {% endif %}
  13.                 {% set productSliderOptions = {
  14.                     productboxMinWidth: sliderConfig.elMinWidth.value ? sliderConfig.elMinWidth.value : '220px',
  15.                     slider: {
  16.                         gutter: 20,
  17.                         autoplayButtonOutput: false,
  18.                         nav: false,
  19.                         mouseDrag: false,
  20.                         controls: sliderConfig.navigation.value ? true : false,
  21.                         autoplay: sliderConfig.rotate.value ? true : false
  22.                     }
  23.                 } %}
  24.                 {% if not sliderConfig.navigation.value %}
  25.                     {% set productSliderOptions = productSliderOptions|replace_recursive({
  26.                         slider: {
  27.                             mouseDrag: true
  28.                         }
  29.                     }) %}
  30.                 {% endif %}
  31.                 {% block element_product_slider_slider %}
  32.                     <div
  33.                         class="base-slider product-slider{% if sliderConfig.border.value %} has-border{% endif %}{% if sliderConfig.navigation.value %} has-nav{% endif %}"
  34.                         data-product-slider="true"
  35.                         data-product-slider-options="{{ productSliderOptions|json_encode }}">
  36.                         {% block element_product_slider_title %}
  37.                             {% if sliderConfig.title.value %}
  38.                                 <div class="cms-element-title">
  39.                                     <p class="cms-element-title-paragraph">{{ sliderConfig.title.value }}</p>
  40.                                 </div>
  41.                             {% endif %}
  42.                         {% endblock %}
  43.                         {% block element_product_slider_inner %}
  44.                             {% block element_product_slider_element %}
  45.                                 <div class="product-slider-container"
  46.                                      data-product-slider-container="true">
  47.                                     {% for product in element.data.products.elements %}
  48.                                         {% block element_product_slider_inner_item %}
  49.                                             <div class="product-slider-item">
  50.                                                 {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  51.                                                     'layout': sliderConfig.boxLayout.value,
  52.                                                     'displayMode': sliderConfig.displayMode.value
  53.                                                 } %}
  54.                                             </div>
  55.                                         {% endblock %}
  56.                                     {% endfor %}
  57.                                 </div>
  58.                             {% endblock %}
  59.                             {% block element_product_slider_controls %}
  60.                                 {% if sliderConfig.navigation.value %}
  61.                                     <div class="product-slider-controls-container">
  62.                                         <div class="base-slider-controls"
  63.                                              data-product-slider-controls="true">
  64.                                             {% block element_product_slider_controls_items %}
  65.                                                 <button
  66.                                                     class="base-slider-controls-prev product-slider-controls-prev{% if sliderConfig.border.value %} has-border{% endif %}">
  67.                                                     {% block element_product_slider_controls_items_prev_icon %}
  68.                                                         {% sw_icon 'arrow-head-left' %}
  69.                                                     {% endblock %}
  70.                                                 </button>
  71.                                                 <button
  72.                                                     class="base-slider-controls-next product-slider-controls-next{% if sliderConfig.border.value %} has-border{% endif %}">
  73.                                                     {% block element_product_slider_controls_items_next_icon %}
  74.                                                         {% sw_icon 'arrow-head-right' %}
  75.                                                     {% endblock %}
  76.                                                 </button>
  77.                                             {% endblock %}
  78.                                         </div>
  79.                                     </div>
  80.                                 {% endif %}
  81.                             {% endblock %}
  82.                         {% endblock %}
  83.                     </div>
  84.                 {% endblock %}
  85.                 {% if config.verticalAlign.value %}
  86.                     </div>
  87.                 {% endif %}
  88.             {% endblock %}
  89.         </div>
  90.     {% endif %}
  91. {% endblock %}