templates/areas/media-slider/view.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2.     <div class="edit-box">
  3.         <h1>KONFIGURATIONEN FÜR DEN AREABRICK:</h1>
  4.         <div class="flex gap-20">
  5.             <div class="content flex column gap-20">
  6.                 <div class="content-box flex gap-20">
  7.                     <div class="item">
  8.                         <p class="edit-p">Abstand nach unten wählen:</p>
  9.                         {{ pimcore_select("MarginBottom", {
  10.                             "reload": true,
  11.                             "store": [
  12.                                 ["regular", "Normal"],
  13.                                 ["half", "1/2"],
  14.                                 ["small", "1/4"],
  15.                                 ["zero", "kein Abstand"],
  16.                             ],
  17.                             "defaultValue" : "regular"
  18.                         }) }}
  19.                     </div>
  20.                     <div class="item">
  21.                         <div class="relation-container">
  22.                             {{ pimcore_relations("MediaSlider", {
  23.                                 "title": "MediaSlider Objekte ablegen",
  24.                                 "types": ["object"],
  25.                                 "width": 600,
  26.                                 "subtypes": {
  27.                                     "object": ["object"]
  28.                                 },
  29.                                 "classes": ["MediaSlider"]
  30.                             }) }}
  31.                         </div>
  32.                     </div>
  33.                 </div>
  34.             </div>
  35.         </div>
  36.     </div>
  37. {% endif %}
  38. <section class="media-slider {{ pimcore_select('MarginBottom').getData() }}">
  39.     <div class="slider-wrapper">
  40.         {% set mediaSlider = pimcore_relations("MediaSlider") %}
  41.         
  42.         {% for slider in mediaSlider %}
  43.             <div class="slider-slide {% if loop.first %}--active{% endif %} {% if slider.videoWebm is not null or slider.videoMp4 is not null %}--video{% endif %} {% if slider.youtubeId %}--youtube{% endif %}">
  44.                 
  45.                 {% if slider.videoWebm is not null or slider.videoMp4 is not null %}
  46.                     <button class="slider-video-play-button">{{ include('svg/play.html.twig') }}</button>
  47.                     {% set posterPath = slider.image ?  slider.image.getRealFullPath() : null %}
  48.                     <video class="slider-video" controls playsinline preload="none" {% if posterPath %} poster="{{ posterPath }}"{% endif %}>
  49.                         {% if slider.videoWebm is not null %}
  50.                             <source src="{{ slider.videoWebm.getRealFullPath() }}" type="video/webm">
  51.                         {% endif %}
  52.                         {% if slider.videoMp4 is not null %}
  53.                             <source src="{{ slider.videoMp4.getRealFullPath() }}" type="video/mp4">
  54.                         {% endif %}
  55.                         Your browser does not support the video tag.
  56.                     </video>
  57.                 {% elseif slider.youtubeId is not null %}
  58.                     <iframe 
  59.                         class="slider__video --youtube"
  60.                         src="https://www.youtube-nocookie.com/embed/{{ slider.youtubeId }}?autoplay=0&modestbranding=1&iv_load_policy=3" 
  61.                         frameboreder="0"
  62.                         allow="autoplay; encrypted-media" 
  63.                         allowfullscreen
  64.                     ></iframe>
  65.                 {% elseif slider.image %}
  66.                     {{ slider.image.thumbnail('MediaSlider').html({imgAttributes: {
  67.                         'loading': 'eager',
  68.                     }}) | raw }}
  69.                 {% endif %}
  70.                 <div class="slider-caption">
  71.                     {% if slider.caption %}
  72.                         {{ slider.caption|raw }}
  73.                     {% endif %}
  74.                 </div>
  75.             </div>
  76.         {% endfor %}
  77.         {% if mediaSlider|length > 1 %}
  78.             <button class="slider-prev">{{ include('svg/icon-chevron-left.html.twig') }}</button>
  79.             <button class="slider-next">{{ include('svg/icon-chevron-left.html.twig') }}</button>
  80.         
  81.             <div class="slider-pagination">
  82.                 {% for slider in mediaSlider %}
  83.                     <div class="slider-pagination-item {% if loop.first %}--active{% endif %}"></div>
  84.                 {% endfor %}
  85.             </div>
  86.         {% endif %}
  87.     </div>
  88. </section>