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

Open in your IDE?
  1. {% set sliderBlockName = 'slideblockname' %}
  2. <section class="section-banner {{ sliderBlockName }} p-0 {% if not editmode %}{% endif %} position-relative" data-aos="zoom-out">
  3.     {% if editmode %}
  4.         <div class="container">
  5.             <div class="row">
  6.                 <div class="col-12">
  7.                     <div class="alert alert-primary d-flex align-items-center">
  8.                         {{ 'Afbeelding of video?'|trans({}, 'admin') }}
  9.                         {{ pimcore_select("media", {
  10.                             "store": [
  11.                                 ["image", "Image"],
  12.                                 ["video", "Video"],
  13.                             ],
  14.                             "defaultValue" : "image",
  15.                             "reload" : true,
  16.                             "class": "ms-3"
  17.                         }) }}
  18.                     </div>
  19.                 </div>
  20.             </div>
  21.         </div>
  22.         <div class="container mb-5">
  23.             <div class="row">
  24.                 <div class="col-12">
  25.                     {% if pimcore_select("media").getData() == "image" %}
  26.                         {% set message = 'Slideshow: druk op + om een slide toe te voegen' %}
  27.                         {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  28.                         {% set block = pimcore_block(sliderBlockName, {'reload' : true, 'limit' : 6}) %}
  29.                         {% for blockcontent in block.iterator %}
  30.                             <div class="border border-primary p-3 mb-3">
  31.                                 <div class="form-group mb-2">
  32.                                     {% set message = 'Afbeelding ' ~ loop.index %}
  33.                                     {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  34.                                     {{ pimcore_image("slideshowImage", {
  35.                                         "title" : "Drag your image here",
  36.                                         "width" : 200,
  37.                                         "height" : 200,
  38.                                     }) }}
  39.                                 </div>
  40.                                 {#
  41.                                                                                                                                                                                                 <div class="form-group mb-2">
  42.                                                                                                                                                                                                     {% set message = 'Titel' %}
  43.                                                                                                                                                                                                     {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  44.                                                                                                                                                                 
  45.                                                                                                                                                                 
  46.                                                                                                                                                                                                     {{ pimcore_input("titel", {
  47.                                                                                                                                                                                                         "class": "form-control",
  48.                                                                                                                                                                                                         "placeholder" : "Titel"|trans({}, 'admin')
  49.                                                                                                                                                                                                     }) }}
  50.                                                                                                                                                                 
  51.                                                                                                                                                                                                     {{ pimcore_textarea("titel",{
  52.                                                                                                                                                                                                         "nl2br": true,
  53.                                                                                                                                                                                                         "height": 300,
  54.                                                                                                                                                                                                         "placeholder": "Titel"|trans({}, 'admin')
  55.                                                                                                                                                                                                     }) }}
  56.                                                                                                                                                                 
  57.                                                                                                                                                                                                 </div>#}
  58.                                 <div class="form-group mb-2">
  59.                                     {% set message = 'Tekst' %}
  60.                                     {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  61.                                     {{ pimcore_textarea("slidertext", {
  62.                                         "class": "form-control",
  63.                                         "placeholder" : "Tekst slider"|trans({}, 'admin'),
  64.                                         "nl2br": true
  65.                                     }) }}
  66.                                 </div>
  67.                                 <div class="form-group mb-2">
  68.                                     {% set message = 'WYSIWYG' %}
  69.                                     {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  70.                                     {{ pimcore_wysiwyg("sliderwysiwyg", {
  71.                                         "class": "form-control"
  72.                                     }) }}
  73.                                 </div>
  74.                                 <div class="form-group mb-2">
  75.                                     {% set message = 'Klik op knop (potlood) om de link in te stellen' %}
  76.                                     {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
  77.                                     {{ pimcore_link("bannerLink") }}
  78.                                 </div>
  79.                             </div>
  80.                         {% endfor %}
  81.                     {% endif %}
  82.                     {% if pimcore_select("media").getData() == "video" %}
  83.                         {% if pimcore_select("media").getData() == "video" %}
  84.                             {{ 'Video'|trans({}, 'admin') }}
  85.                             {{ pimcore_video('bannerVideo', {
  86.                                 width: 200,
  87.                                 height: 150
  88.                             }) }}
  89.                         {% endif %}
  90.                     {% endif %}
  91.                 </div>
  92.             </div>
  93.         </div>
  94.     {% endif %}
  95.     {% if not editmode %}
  96.         <div class="section-banner {{ sliderBlockName }} p-0">
  97.             {% if pimcore_select("media").getData() == "image" %}
  98.                 <div id="{{ sliderBlockName }}" class="carousel slide carousel-home" data-bs-ride="carousel">
  99.                     {% set amount = pimcore_block(sliderBlockName).getCount() - 1 %}
  100.                     {% if amount > 0 %}
  101.                         <ol class="carousel-indicators">
  102.                             {% for i in 0..amount %}
  103.                                 <li data-bs-target="#{{ sliderBlockName }}" data-bs-slide-to="{{ i }}" class={% if i == 0 %} "active" aria-current="true" {% endif %}></li>
  104.                             {% endfor %}
  105.                         </ol>
  106.                     {% endif %}
  107.                     <div class="carousel-inner">
  108.                         {% set blocks = pimcore_block(sliderBlockName, {'limit' : 6}) %}
  109.                         {% for block in blocks.iterator %}
  110.                             {% set current = blocks.getCurrent() %}
  111.                             {% set link = pimcore_link("bannerLink").getHref() %}
  112.                             {% if link is defined %}
  113.                                 {% set target = pimcore_link("bannerLink").getTarget() %}
  114.                                 {% set linktext = pimcore_link("bannerLink").getText() %}
  115.                             {% endif %}
  116.                             <div class="carousel-item {% if current == 0 %}active{% endif %}" id="slide-{{ current }}">
  117.                                 <div class="image position-relative" data-thumbnail="{{ pimcore_image('slideshowImage').getThumbnail('slideshow-homepage') }}" style="background-image: url({{ pimcore_image('slideshowImage').getThumbnail('slideshow-homepage') }});">
  118.                                     <div class="container position-relative h-75">
  119.                                         <div class="row align-items-center h-100">
  120.                                             <div class="col-6 text-white py-5">
  121.                                                 {# {{ pimcore_input("titel") }} #}
  122.                                                 {% if not pimcore_textarea("slidertext").isEmpty() %}
  123.                                                     <h1 class="mb-5 text-white display-1 fw-bold" style="text-shadow: 2px 2px 8px rgba(0,0,0,0.6);">{{ pimcore_textarea("slidertext") }}</h1>
  124.                                                 {% endif %}
  125.                                                 {% if not pimcore_wysiwyg("sliderwysiwyg").isEmpty() %}
  126.                                                     <h1 class="mb-5 text-white display-1 fw-bold">{{ pimcore_wysiwyg("sliderwysiwyg") }}</h1>
  127.                                                 {% endif %}
  128.                                                 {% if link is defined and not pimcore_link("bannerLink").isEmpty() %}
  129.                                                     <a href="{{ link }}" target="{{ target }}" class="btn btn-secondary">{{ linktext }}</a>
  130.                                                 {% endif %}
  131.                                             </div>
  132.                                         </div>
  133.                                     </div>
  134.                                 </div>
  135.                             </div>
  136.                         {% endfor %}
  137.                     </div>
  138.                     {% if amount > 0 %}
  139.                         <a class="carousel-control-prev" type="button" data-bs-target="#{{ sliderBlockName }}" role="button" data-bs-slide="prev">
  140.                             <span class="carousel-control-prev-icon" aria-hidden="true"></span>
  141.                             <span class="visually-hidden">{{ 'Previous'|trans }}</span>
  142.                         </a>
  143.                         <a class="carousel-control-next" type="button" data-bs-target="#{{ sliderBlockName }}" role="button" data-bs-slide="next">
  144.                             <span class="carousel-control-next-icon" aria-hidden="true"></span>
  145.                             <span class="visually-hidden">{{ 'Next'|trans }}</span>
  146.                         </a>
  147.                     {% endif %}
  148.                 </div>
  149.             {% endif %}
  150.             {% if pimcore_select("media").getData() == "video" %}
  151.                 <div class="header-media">
  152.                     {{ pimcore_video('bannerVideo', {
  153.                     attributes: {
  154.                         'preload': 'auto',
  155.                         'controls': '',
  156.                         'autoplay' : '',
  157.                         'playsinline': '',
  158.                         'muted' : '',
  159.                         'loop': 'loop',
  160.                         'width': '100%',
  161.                         'height': '100%'
  162.                     }
  163.                 }) }}
  164.                 </div>
  165.             {% endif %}
  166.         </div>
  167.     {% endif %}
  168.     <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" viewbox="0 0 3869.3 565.1" style="enable-background:new 0 0 3869.3 565.1;" xml:space="preserve">
  169.         <style type="text/css">
  170.             .st0 {
  171.                 fill: #FFFFFF;
  172.             }
  173.         </style>
  174.         <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
  175.                                             c52.8,15.7,213.9,31.6,435.6-30.9C718.3,38.9,1157.3-92.3,1652.2,98.8z"/>
  176.     </svg>
  177. </section>