src/Trinity/SliderBundle/Resources/views/default/slider.html.twig line 1

Open in your IDE?
  1. {% if file_exists('../templates/override/slider/slider.html.twig') %}
  2.   {% include 'override/slider/slider.html.twig' %}
  3. {% else %}
  4. <div {% if Slider.height is not null and Slider.height > 0 %}style="height: {{ Slider.height }};"{% endif %} id="slider_{{Slider.id}}" class="slider-container {{Slider.classes}}">
  5.   <div class="swiper-content">
  6.     <div class="swiper-container slider_bundle slider_bundle_{{Slider.id}}"
  7.         data-speed="{% if Slider.scrollspeed is not empty %}{{ Slider.scrollspeed }}{% else %}1000{% endif %}"
  8.         data-fade="{% if Slider.fade %}true{% else %}false{% endif %}"
  9.         data-autoplay="{% if Slider.autoplay %}true{% else %}false{% endif %}"
  10.         data-autoplaydelay="{% if Slider.autospeed > 0 %}{{ Slider.autospeed }}{% else %}8000{% endif %}"
  11.         data-centered="{% if Slider.centermode %}true{% else %}false{% endif %}"
  12.         data-loop="{% if Slider.infinite %}true{% else %}false{% endif %}"
  13.         data-id="{{Slider.id}}"
  14.     >
  15.       <div class="swiper-wrapper">
  16.         {% for Entry in entries %}
  17.             {% if Entry.slideUrl is not null %}
  18.               <a href="{{ Entry.slideUrl }}" class="swiper-slide {{ Entry.classes }}" {% if Slider.height is not null and Slider.height > 0 %}style="height: {{ Slider.height }};"{% endif %}>
  19.             {% else %}
  20.               <div class="swiper-slide {{ Entry.classes }}" {% if Slider.height is not null and Slider.height > 0 %}style="height: {{ Slider.height }};"{% endif %}>
  21.             {% endif %}
  22.               {% if Entry.mobilemedia %}
  23.                 <div class="image d-md-none">
  24.                   <div class="lcp">
  25.                     {% if Entry.mobilemedia is not empty %}
  26.                       {% if Entry.mobilemedia.hasBlurred %}
  27.                         <picture>
  28.                           {% if Entry.mobilemedia.hasWebp() %}
  29.                             <source srcset="/{{Entry.mobilemedia.getBlurredWebpPath('large')}}" type="image/webp">
  30.                           {% endif %}
  31.                           <source srcset="/{{Entry.mobilemedia.getBlurredWebPath('large')}}" type="{{Entry.mobilemedia.mime}}">
  32.                           <img class="lq" alt="{{Entry.mobilemedia.description_alt}}" src="/{{Entry.mobilemedia.getBlurredWebPath('large')}}" type="{{Entry.mobilemedia.mime}}" loading="eager" width="{{Entry.mobilemedia.width}}" height="{{Entry.mobilemedia.height}}">
  33.                         </picture>
  34.                       {% endif %}
  35.                       <picture>
  36.                         {% if Entry.mobilemedia.hasWebp() %}
  37.                           <source srcset="/{{Entry.mobilemedia.getWebpPath('large')}}" type="image/webp">
  38.                         {% endif %}
  39.                         <source srcset="/{{Entry.mobilemedia.getWebPath('large')}}" type="{{ Entry.mobilemedia.mime }}">
  40.                       <img class="hq" alt="{{Entry.mobilemedia.description_alt}}" src="/{{Entry.mobilemedia.getWebPath('large')}}" type="{{Entry.mobilemedia.mime}}" loading="eager" width="{{Entry.mobilemedia.width}}" height="{{Entry.mobilemedia.height}}" onload="this.style.opacity=1{% if Entry.mobilemedia.hasBlurred %};this.closest('.lcp').getElementsByClassName('lq')[0].style.opacity=0;{% endif %}" style="opacity: 0;">
  41.                       </picture>
  42.                     {% endif %}
  43.                   </div>
  44.                 </div>
  45.               {% endif %}
  46.               <div class="image {% if Entry.mobilemedia %}d-none d-md-block{% endif %}">
  47.                 <div class="lcp">
  48.                   {% if Entry.Media is not empty %}
  49.                     {% if Entry.Media.hasBlurred %}
  50.                       <picture>
  51.                         {% if Entry.Media.hasWebp() %}
  52.                           <source srcset="/{{Entry.Media.getBlurredWebpPath('full')}}" type="image/webp">
  53.                         {% endif %}
  54.                         <source srcset="/{{Entry.Media.getBlurredWebPath('full')}}" type="{{Entry.Media.mime}}">
  55.                         <img class="lq" alt="{{Entry.Media.description_alt}}" src="/{{Entry.Media.getBlurredWebPath('full')}}" type="{{Entry.Media.mime}}" loading="eager" width="{{Entry.Media.width}}" height="{{Entry.Media.height}}">
  56.                       </picture>
  57.                     {% endif %}
  58.                     <picture>
  59.                       {% if Entry.Media.hasWebp() %}
  60.                         <source srcset="/{{Entry.Media.getWebpPath('full')}}" type="image/webp">
  61.                       {% endif %}
  62.                       <source srcset="/{{Entry.Media.getWebPath('full')}}" type="{{ Entry.Media.mime }}">
  63.                     <img class="hq" alt="{{Entry.Media.description_alt}}" src="/{{Entry.Media.getWebPath('full')}}" type="{{Entry.Media.mime}}" loading="eager" width="{{Entry.Media.width}}" height="{{Entry.Media.height}}" onload="this.style.opacity=1{% if Entry.Media.hasBlurred %};this.closest('.lcp').getElementsByClassName('lq')[0].style.opacity=0;{% endif %}" style="opacity: 0;">
  64.                     </picture>
  65.                   {% endif %}
  66.                 </div>
  67.               </div>
  68.               {% if Entry.getLabel is not empty %}
  69.                 <div class="container">
  70.                   <div class="vtable">
  71.                     <div class="vcell">
  72.                       <div class="titles">
  73.                         <div class="row align-items-end">
  74.                           <div class="col-12 {% if Entry.slideUrl is null %}col-md-6{% endif %}">
  75.                             {% if Slider.showTitle %}
  76.                               <h2 class="slide-title">{{Entry.getLabel|raw}}</h2>
  77.                             {% endif %}
  78.                             {% if Slider.showContent %}
  79.                               {{Entry.getContent|raw}}
  80.                             {% endif %}
  81.                           </div>
  82.                           {% if Entry.slideUrl is null %}
  83.                             <div class="col-12 col-md-6">
  84.                               {% if Entry.buttons and Entry.buttons is not empty %}
  85.                                 <div class="slide-buttons text-md-end">
  86.                                   {% for button in Entry.buttons %}
  87.                                     <a href="{{button.url}}" title="{{button.label}}" {% if button.target is defined and button.target != "null" %} target="{{button.target}}" {% endif %} class="btn {{button.class}}">{{button.label}} <i class="fa fa-arrow-right"></i></a>
  88.                                   {% endfor %}
  89.                                 </div>
  90.                               {% endif %}
  91.                             </div>
  92.                           {% endif %}
  93.                         </div>
  94.                       </div>
  95.                     </div>
  96.                   </div>
  97.                 </div>
  98.               {% endif %}
  99.             {% if Entry.slideUrl is not null %}
  100.               </a>
  101.             {% else %}
  102.               </div>
  103.             {% endif %}
  104.         {% endfor %}
  105.       </div>
  106.       {% if Slider.dots %}
  107.       <div class="swiper-pagination swiper-pagination_{{Slider.id}}"></div>
  108.       {% endif %}
  109.       {% if Slider.arrows %}
  110.       <div class="swiper-button-prev swiper-button-prev_{{Slider.id}}"></div>
  111.       <div class="swiper-button-next swiper-button-next_{{Slider.id}}"></div>
  112.       {% endif %}
  113.     </div>
  114.   </div>
  115. </div>
  116. {% endif %}