{# recup uniquement les photos #}
{% set arr = [] %}
{% for img in allImgs %}
{% set lengthA = img.imgUrlFile|length %}
{% set ext = img.imgUrlFile|slice((lengthA - 3), 3) %}
{% if ext == 'mp4' or ext == 'm4v' %}
{% else %}
{% if img.actif == 1 %}
{% set arr = arr|merge({(img.ordre): img}) %}
{% endif %}
{% endif %}
{% endfor %}
{% if arr|length > 2 %}
{% set img1 = arr[0] %}
{% set img2 = arr[1] %}
{% set img3 = arr[2] %}
{% endif %}
<div class="container">
<div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
{% set max = (arr|length) - 1 %}
{% set tour = 0 %}
{% for vign in arr %}
<div class="carousel-item{% if tour == 0 %} active{% endif %} bg"
style="background-image:url({{ pathLocal }}uploads/mobilier/640/v_{{ vign.imgUrlFile }})"
>
</div>
{% set tour = tour + 1 %}
{% endfor %}
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
<div class="carousel-indicators">
{% set tourA = 0 %}
{% for vign in arr %}
<button type="button"
data-bs-target="#carouselExampleCaptions"
data-bs-slide-to="{{ tourA }}"
{% if tourA == 0 %}class="active" aria-current="true"{% endif %}
aria-label="Slide {{ ( tourA + 1 ) }}">
<img src="{{ pathLocal }}uploads/mobilier/640/v_{{ vign.imgUrlFile }}" alt="up-paris" class="d-block w-100 img-fluid">
</button>
{% set tourA = tourA + 1 %}
{% endfor %}
</div>
</div>
</div>