bs-carousel.html.twig in Bootstrap Kit 8.4
{% if content %}
{% set id = random() %}
<div {{ attributes.addClass('carousel slide bg-faded').removeAttribute('id') }} data-ride="carousel" id="carousel-{{ id }}">
<!-- Indicators -->
<ol class="carousel-indicators">
{% for region in layout.getRegionNames if content[region] %}
<li class="{{ loop.first ? 'active' }}" data-target="#carousel-{{ id }}" data-slide-to="{{ loop.index0 }}"></li>
{% endfor %}
</ol>
<!-- Slides -->
<div class="carousel-inner">
{% for region in layout.getRegionNames if content[region] %}
<div class="carousel-item {{ loop.first ? 'active' }}">
{{ content[region] }}
</div>
{% endfor %}
</div>
<!-- Controls -->
<a class="carousel-control-prev" href="#carousel-{{ id }}" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#carousel-{{ id }}" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
{% endif %}
File
templates/bs-carousel.html.twig
View source
- {% if content %}
- {% set id = random() %}
- <div {{ attributes.addClass('carousel slide bg-faded').removeAttribute('id') }} data-ride="carousel" id="carousel-{{ id }}">
-
- <!-- Indicators -->
- <ol class="carousel-indicators">
- {% for region in layout.getRegionNames if content[region] %}
- <li class="{{ loop.first ? 'active' }}" data-target="#carousel-{{ id }}" data-slide-to="{{ loop.index0 }}"></li>
- {% endfor %}
- </ol>
-
- <!-- Slides -->
- <div class="carousel-inner">
- {% for region in layout.getRegionNames if content[region] %}
- <div class="carousel-item {{ loop.first ? 'active' }}">
- {{ content[region] }}
- </div>
- {% endfor %}
- </div>
-
- <!-- Controls -->
- <a class="carousel-control-prev" href="#carousel-{{ id }}" data-slide="prev">
- <span class="carousel-control-prev-icon"></span>
- </a>
- <a class="carousel-control-next" href="#carousel-{{ id }}" data-slide="next">
- <span class="carousel-control-next-icon"></span>
- </a>
-
- </div>
- {% endif %}