templates/layouts/layout/slideshow/slideshow.html.twig line 1

Open in your IDE?
  1. {% set sliderBlockName = 'slideblockname' %}
  2. <section class=" {{ sliderBlockName }} p-0 mb-5 position-relative"  data-aos="zoom-out">
  3.     {% if editmode %}
  4.         <div class="container">
  5.             <div class="row">
  6.                 <div class="col-12">
  7.                     {% set message = 'Slideshow: druk op + om een slide toe te voegen' %}
  8.                     {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  9.                     {% set block = pimcore_block(sliderBlockName, {'reload' : true, 'limit' : 6}) %}
  10.                     {% for blockcontent in block.iterator %}
  11.                         <div class="border border-primary p-3 mb-3">
  12.                             <div class="form-group mb-2">
  13.                                 {% set message = 'Afbeelding ' ~ loop.index %}
  14.                                 {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  15.                                 {{ pimcore_image("slideshowImage", {
  16.                                     "title" : "Drag your image here",
  17.                                     "width" : 200,
  18.                                     "height" : 200,
  19.                                 }) }}
  20.                             </div>
  21.                             <div class="form-group mb-2">
  22.                                 {% set message = 'Titel' %}
  23.                                 {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  24.                                 {{ pimcore_input("titel", {
  25.                                     "class": "form-control",
  26.                                     "placeholder" : "Titel"|trans({}, 'admin')
  27.                                 }) }}
  28.                             </div>
  29.                             <div class="form-group mb-2">
  30.                                 {% set message = 'Tekst' %}
  31.                                 {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  32.                                 {{ pimcore_textarea("slidertext", {
  33.                                     "class": "form-control",
  34.                                     "placeholder" : "Tekst slider"|trans({}, 'admin'),
  35.                                     "nl2br": true
  36.                                 }) }}
  37.                             </div>
  38.                             <div class="form-group mb-2">
  39.                                 {% set message = 'Klik op knop (potlood) om de link in te stellen' %}
  40.                                 {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  41.                                 {{ pimcore_link("bannerLink") }}
  42.                             </div>
  43.                         </div>
  44.                     {% endfor %}
  45.                 </div>
  46.             </div>
  47.         </div>
  48.         <hr style="margin-top:50px;margin-bottom:100px;">
  49.     {% endif %}
  50.     {% if not editmode %}
  51.         {% set amount = pimcore_block(sliderBlockName).getCount() - 1 %}
  52.         {% if amount > -1 %}
  53.         <div class="section-banner {{ sliderBlockName }} p-0">
  54.             <div id="{{ sliderBlockName }}" class="carousel slide" data-bs-ride="carousel">
  55.                 {% if amount > 0 %}
  56.                     <ol class="carousel-indicators">
  57.                         {% for i in 0..amount %}
  58.                             <li data-bs-target="#{{ sliderBlockName }}" data-bs-slide-to="{{ i }}" class={% if i == 0 %}"active" aria-current="true"{% endif %}></li>
  59.                         {% endfor %}
  60.                     </ol>
  61.                 {% endif %}
  62.                 <div class="carousel-inner">
  63.                     {% set blocks = pimcore_block(sliderBlockName, {'limit' : 6}) %}
  64.                     {% for block in blocks.iterator %}
  65.                         {% set current = blocks.getCurrent() %}
  66.                         {% set link = pimcore_link("bannerLink").getHref() %}
  67.                         {% if link is defined %}
  68.                             {% set target = pimcore_link("bannerLink").getTarget() %}
  69.                             {% set linktext = pimcore_link("bannerLink").getText() %}
  70.                         {% endif %}
  71.                         <div class="carousel-item {% if current == 0 %}active{% endif %}" id="slide-{{ current }}">
  72.                             <div class="image position-relative" data-thumbnail="{{ pimcore_image("slideshowImage").getThumbnail("slideshow-homepage") }}" style="background-image: url({{ pimcore_image("slideshowImage").getThumbnail("slideshow-homepage") }});">
  73.                                 <div class="container position-relative h-100">
  74.                                     <div class="row align-items-center h-75">
  75.                                         <div class="col-6 text-white py-5">
  76.                                             <h1 class="text-white">{{ pimcore_input("titel") }}</h1>
  77.                                             {% if not pimcore_textarea("slidertext").isEmpty() %}
  78.                                                 <p>{{ pimcore_textarea("slidertext") }}</p>
  79.                                             {% endif %}
  80.                                             {% if link is defined and not pimcore_link("bannerLink").isEmpty() %}
  81.                                                 <a href="{{ link }}" target="{{ target }}"  class="btn btn-primary">{{ linktext }}</a>
  82.                                             {% endif %}
  83.                                         </div>
  84.                                     </div>
  85.                                 </div>
  86.                             </div>
  87.                         </div>
  88.                     {% endfor %}
  89.                 </div>
  90.                 {% if amount > 0 %}
  91.                     <a class="carousel-control-prev" type="button" data-bs-target="#{{ sliderBlockName }}" role="button" data-bs-slide="prev">
  92.                         <span class="carousel-control-prev-icon" aria-hidden="true"></span>
  93.                         <span class="visually-hidden">{{ 'Previous'|trans }}</span>
  94.                     </a>
  95.                     <a class="carousel-control-next" type="button" data-bs-target="#{{ sliderBlockName }}" role="button" data-bs-slide="next">
  96.                         <span class="carousel-control-next-icon" aria-hidden="true"></span>
  97.                         <span class="visually-hidden">{{ 'Next'|trans }}</span>
  98.                     </a>
  99.                 {% endif %}
  100.             </div>
  101.         </div>
  102.         <svg version="1.1" class="{% if not editmode %}position-absolute bottom-0 start-0 mb-n5{% endif %}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
  103.              viewBox="0 0 3869.3 565.1" style="enable-background:new 0 0 3869.3 565.1;" xml:space="preserve">
  104. <style type="text/css">
  105.     .st0{fill:#FFFFFF;}
  106. </style>
  107.             <path class="st0" d="M1652.2,98.8c495,191.1,690.4,185.6,946.4,176.8c256-8.8,642-103.8,1270.7,181.3l-1.5,108.1H0L5.7,148
  108.     c52.8,15.7,213.9,31.6,435.6-30.9C718.3,38.9,1157.3-92.3,1652.2,98.8z"/>
  109. </svg>
  110.     {% endif %}
  111.     {% endif %}
  112. </section>