custom/plugins/BlurElysiumSlider/src/Resources/views/storefront/element/cms-element-blur-elysium-slider.html.twig line 1

Open in your IDE?
  1. {% block cms_element_blur_elysium_slider_root %}
  2.     {% set sliderOverlay = element.translated.config.sliderOverlay.value %}
  3.     {% set sliderSettingsNav = element.translated.config.sliderNavigation.value %}
  4.     {% set slideSpeed = element.translated.config.slideSpeed.value %}
  5.     {% set sliderAutoplay = element.translated.config.sliderAutoplay.value %}
  6.     {% set sliderAutoplayTimeout = element.translated.config.sliderAutoplayTimeout.value %}
  7.     {% set sliderArrowColors = element.translated.config.sliderArrowColor.value %}
  8.     {% set sliderDotColors = element.translated.config.sliderDotColor.value %}
  9.     {% set sliderDotActiveColors = element.translated.config.sliderDotActiveColor.value %}
  10.     {% set sliderAspectRatio = element.translated.config.aspectRatio.value %}
  11.     {% set sliderSettings = {
  12.         nav: sliderSettingsNav,
  13.         navContainer: '[data-base-slider-nav=true]',
  14.         controls: true,
  15.         loop: false,
  16.         rewind: true,
  17.         speed: slideSpeed,
  18.         autoplay: sliderAutoplay,
  19.         autoplayTimeout: sliderAutoplayTimeout,
  20.         autoplayHoverPause: true,
  21.         autoplayButtonOutput: false
  22.     } %}
  23.     {% block cms_element_blur_elysium_slider_css_styles %}
  24.         {% apply spaceless %}
  25.             <style>
  26.                 #elysiumSlider-{{ element.id }} .cms-element-elysium-slide {
  27.                     {% if sliderAspectRatio.landscape %}
  28.                         aspect-ratio: auto {{ sliderAspectRatio.landscape.width }} / {{ sliderAspectRatio.landscape.height }};
  29.                     {% endif %}
  30.                 }
  31.                 {% if sliderArrowColors %}
  32.                     #elysiumSlider-{{ element.id }} .cms-element-elysium-slider__control-button {
  33.                         color: {{ sliderArrowColors }};
  34.                     }                
  35.                 {% endif %}
  36.                 {% if sliderDotColors %}
  37.                     #elysiumSlider-{{ element.id }} .cms-element-elysium-slider__navigation-bullet {
  38.                         background-color: {{ sliderDotColors }};
  39.                     }                
  40.                 {% endif %}
  41.                 {% if sliderDotActiveColors %}
  42.                     #elysiumSlider-{{ element.id }} .cms-element-elysium-slider__navigation-bullet:hover,
  43.                     #elysiumSlider-{{ element.id }} .cms-element-elysium-slider__navigation-bullet.tns-nav-active {
  44.                         background-color: {{ sliderDotActiveColors }};
  45.                     }                
  46.                 {% endif %}
  47.                 {% if sliderAspectRatio.portrait %}
  48.                     @media screen and (orientation: portrait) {
  49.                         #elysiumSlider-{{ element.id }} .cms-element-elysium-slide {
  50.                             aspect-ratio: auto {{ sliderAspectRatio.portrait.width }} / {{ sliderAspectRatio.portrait.height }};
  51.                         }                        
  52.                     }
  53.                 {% endif %}
  54.                 {% block cms_element_blur_elysium_slider_css_styles_extend %}{% endblock %}
  55.             </style>
  56.         {% endapply %}
  57.     {% endblock %}
  58.     {% block cms_element_blur_elysium_slider %}
  59.         {# your could override sliderSettings variables on this block #}
  60.         <div id="elysiumSlider-{{ element.id }}" 
  61.             data-slider-settings='{{ sliderSettings|json_encode }}'
  62.             class="cms-element-elysium-slider{% if sliderSettingsNav %} has-navigation{% endif %}{% if sliderOverlay %} has-overlay{% endif %}">
  63.             {% if element.data.slideCollection is empty %}
  64.                 {% block cms_element_blur_elysium_slider_empty_state %}
  65.                     <!-- no slide collection here -->
  66.                 {% endblock %}
  67.             {% else %}
  68.                 {% block cms_element_blur_elysium_slider_container %}
  69.                     <div class="cms-element-elysium-slider__slide-container">
  70.                         {% for slide in element.data.slideCollection %}
  71.                             <div class="cms-element-elysium-slide__wrapper">
  72.                                 {% block cms_element_blur_elysium_slide_include %}
  73.                                     {% set slideTemplate = 'slide' %}
  74.                                     {% if slide.slideSettings.customTemplateFile %}
  75.                                         {% set slideTemplate = 'custom/' ~ slide.slideSettings.customTemplateFile %}
  76.                                     {% endif %}
  77.                                     {% sw_include '@Storefront/storefront/component/blur-elysium-slide/' ~ slideTemplate ~'.html.twig' ignore missing with {
  78.                                         slide: slide
  79.                                     } only %}
  80.                                 {% endblock %}
  81.                             </div>
  82.                         {% endfor %}
  83.                     </div>
  84.                 {% endblock %}
  85.             
  86.                 {% block cms_element_blur_elysium_slider_controls %}
  87.                     <div class="cms-element-elysium-slider__controls" 
  88.                         data-base-slider-controls="true">
  89.                         
  90.                         {% block cms_element_blur_elysium_slider_controls_prev %}
  91.                             <button type="button" 
  92.                                 class="cms-element-elysium-slider__control-button control-prev"
  93.                                 aria-label="{{ 'blurElysiumSlides.sliderControls.prev' | trans }}">
  94.                                 {% block cms_element_blur_elysium_slider_controls_prev_icon %}
  95.                                     {% sw_icon 'arrow-head-left' %}
  96.                                 {% endblock %}
  97.                             </button>
  98.                         {% endblock %}
  99.                         
  100.                         {% block cms_element_blur_elysium_slider_controls_next %}
  101.                             <button type="button" 
  102.                                 class="cms-element-elysium-slider__control-button control-next"
  103.                                 aria-label="{{ 'blurElysiumSlides.sliderControls.next' | trans }}">
  104.                                 {% block cms_element_blur_elysium_slider_controls_next_icon %}
  105.                                     {% sw_icon 'arrow-head-right' %}
  106.                                 {% endblock %}
  107.                             </button>
  108.                         {% endblock %}
  109.                     </div>
  110.                 {% endblock %}
  111.                 {% block cms_element_blur_elysium_slider_navigation %}
  112.                 
  113.                     {% if sliderSettingsNav %}
  114.                         <div class="cms-element-elysium-slider__navigation" 
  115.                             data-base-slider-nav="true">
  116.                             
  117.                             {% for slide in element.data.slideCollection %}
  118.                                 <div class="cms-element-elysium-slider__navigation-bullet"></div>
  119.                             {% endfor %}
  120.                         </div>                    
  121.                     {% endif %}
  122.                 {% endblock %}
  123.             {% endif %}
  124.         </div>  
  125.     {% endblock %}  
  126. {% endblock %}