file item-list--bootstrap-carousel-indicators.html.twig
Theme override for an item list.
Available variables:
- attributes: HTML attributes to be applied to the list.
- items: A list of items. Each item contains:
- attributes: HTML attributes to be applied to each list item.
- list_type: The tag for list element ("ul" or "ol").
- start_index: (optional) Alters the slide position relative to its current position.
- target: A valid HTML ID for the carousel container.
See Also
- {#
- /**
- * @file
- * Theme override for an item list.
- *
- * Available variables:
- * - attributes: HTML attributes to be applied to the list.
- * - items: A list of items. Each item contains:
- * - attributes: HTML attributes to be applied to each list item.
- * - list_type: The tag for list element ("ul" or "ol").
- * - start_index: (optional) Alters the slide position relative to its current
- * position.
- * - target: A valid HTML ID for the carousel container.
- *
- * @ingroup templates
- *
- * @see template_preprocess_item_list()
- */
- #}
- {% set classes = ['carousel-indicators'] %}
- {% if items %}
- <{{ list_type }}{{ attributes.addClass(classes) }} role="menu">
- {% for item in items %}
- {% set item_classes = [start_index == loop.index0 ? 'active'] %}
- <li{{ item.attributes.addClass(item_classes) }} data-target="{{ target }}" data-slide-to="{{ loop.index0 }}"></li>
- {% endfor %}
- </{{ list_type }}>
- {% endif %}