vendor/shopware/platform/src/Storefront/Resources/views/storefront/element/cms-element-product-slider.html.twig line 1

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