{% set sliderBlockName = 'slideblockname' %}
<section class=" {{ sliderBlockName }} p-0 mb-5 position-relative" data-aos="zoom-out">
{% if editmode %}
<div class="container">
<div class="row">
<div class="col-12">
{% set message = 'Slideshow: druk op + om een slide toe te voegen' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
{% set block = pimcore_block(sliderBlockName, {'reload' : true, 'limit' : 6}) %}
{% for blockcontent in block.iterator %}
<div class="border border-primary p-3 mb-3">
<div class="form-group mb-2">
{% set message = 'Afbeelding ' ~ loop.index %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
{{ pimcore_image("slideshowImage", {
"title" : "Drag your image here",
"width" : 200,
"height" : 200,
}) }}
</div>
<div class="form-group mb-2">
{% set message = 'Titel' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
{{ pimcore_input("titel", {
"class": "form-control",
"placeholder" : "Titel"|trans({}, 'admin')
}) }}
</div>
<div class="form-group mb-2">
{% set message = 'Tekst' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
{{ pimcore_textarea("slidertext", {
"class": "form-control",
"placeholder" : "Tekst slider"|trans({}, 'admin'),
"nl2br": true
}) }}
</div>
<div class="form-group mb-2">
{% set message = 'Klik op knop (potlood) om de link in te stellen' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
{{ pimcore_link("bannerLink") }}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<hr style="margin-top:50px;margin-bottom:100px;">
{% endif %}
{% if not editmode %}
{% set amount = pimcore_block(sliderBlockName).getCount() - 1 %}
{% if amount > -1 %}
<div class="section-banner {{ sliderBlockName }} p-0">
<div id="{{ sliderBlockName }}" class="carousel slide" data-bs-ride="carousel">
{% if amount > 0 %}
<ol class="carousel-indicators">
{% for i in 0..amount %}
<li data-bs-target="#{{ sliderBlockName }}" data-bs-slide-to="{{ i }}" class={% if i == 0 %}"active" aria-current="true"{% endif %}></li>
{% endfor %}
</ol>
{% endif %}
<div class="carousel-inner">
{% set blocks = pimcore_block(sliderBlockName, {'limit' : 6}) %}
{% for block in blocks.iterator %}
{% set current = blocks.getCurrent() %}
{% set link = pimcore_link("bannerLink").getHref() %}
{% if link is defined %}
{% set target = pimcore_link("bannerLink").getTarget() %}
{% set linktext = pimcore_link("bannerLink").getText() %}
{% endif %}
<div class="carousel-item {% if current == 0 %}active{% endif %}" id="slide-{{ current }}">
<div class="image position-relative" data-thumbnail="{{ pimcore_image("slideshowImage").getThumbnail("slideshow-homepage") }}" style="background-image: url({{ pimcore_image("slideshowImage").getThumbnail("slideshow-homepage") }});">
<div class="container position-relative h-100">
<div class="row align-items-center h-75">
<div class="col-6 text-white py-5">
<h1 class="text-white">{{ pimcore_input("titel") }}</h1>
{% if not pimcore_textarea("slidertext").isEmpty() %}
<p>{{ pimcore_textarea("slidertext") }}</p>
{% endif %}
{% if link is defined and not pimcore_link("bannerLink").isEmpty() %}
<a href="{{ link }}" target="{{ target }}" class="btn btn-primary">{{ linktext }}</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% if amount > 0 %}
<a class="carousel-control-prev" type="button" data-bs-target="#{{ sliderBlockName }}" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">{{ 'Previous'|trans }}</span>
</a>
<a class="carousel-control-next" type="button" data-bs-target="#{{ sliderBlockName }}" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">{{ 'Next'|trans }}</span>
</a>
{% endif %}
</div>
</div>
<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">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<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
c52.8,15.7,213.9,31.6,435.6-30.9C718.3,38.9,1157.3-92.3,1652.2,98.8z"/>
</svg>
{% endif %}
{% endif %}
</section>