amp-views-carousel.html.twig in Accelerated Mobile Pages (AMP) 8.3
Default theme implementation for a view template to display a list of rows.
Available variables:
- attributes: HTML attributes for the container.
- rows: A list of rows for this list.
- attributes: The row's HTML attributes.
- content: The row's contents.
- title: The title of this group of rows. May be empty.
- carousel:
- attributes: HTML attributes for the carousel element.
See also
File
templates/amp-views-carousel.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for a view template to display a list of rows.
- *
- * Available variables:
- * - attributes: HTML attributes for the container.
- * - rows: A list of rows for this list.
- * - attributes: The row's HTML attributes.
- * - content: The row's contents.
- * - title: The title of this group of rows. May be empty.
- * - carousel:
- * - attributes: HTML attributes for the carousel element.
- *
- * @see template_preprocess_amp_views_carousel()
- *
- * @ingroup themeable
- */
- #}
- {% if attributes -%}
- <div{{ attributes }}>
- {% endif %}
- {% if title %}
- <h3>{{ title }}</h3>
- {% endif %}
-
- <amp-carousel{{ carousel.attributes|without('autoplay', 'controls', 'loop') }}{% if carousel.attributes.controls %} controls{% endif %}{% if carousel.attributes.autoplay %} autoplay{% endif %}{% if carousel.attributes.loop %} loop{% endif %}>
-
- {% for row in rows %}
- {{ row.content }}
- {% endfor %}
-
- </amp-carousel>
-
- {% if attributes -%}
- </div>
- {% endif %}
-