You are here

flickity-entity-view.html.twig in Flickity Carousel 8

flickity-entity-view.html.twig Default theme implementation to present content in a flickity slideshow.

Available variables:

  • contents: A list of content items. Use 'contents' to print all content.
  • attributes: HTML attributes for the container element.
  • title_attributes: HTML attributes for the title.
  • label_hidden: Whether to show the field label or not.
  • label_display: The display settings for the label.
  • label: The label for the field.

File

modules/fields/templates/flickity-entity-view.html.twig
View source
  1. {#
  2. /**
  3. * @file flickity-entity-view.html.twig
  4. * Default theme implementation to present content in a flickity slideshow.
  5. *
  6. * Available variables:
  7. * - contents: A list of content items. Use 'contents' to print all content.
  8. * - attributes: HTML attributes for the container element.
  9. * - title_attributes: HTML attributes for the title.
  10. * - label_hidden: Whether to show the field label or not.
  11. * - label_display: The display settings for the label.
  12. * - label: The label for the field.
  13. *
  14. * @see template_preprocess_flickity_entity_view()
  15. */
  16. #}
  17. {%
  18. set classes = [
  19. 'carousel',
  20. 'field--label-' ~ label_display,
  21. ]
  22. %}
  23. {%
  24. set title_classes = [
  25. 'field__label',
  26. label_display == 'visually_hidden' ? 'visually-hidden',
  27. ]
  28. %}
  29. {% if contents %}
  30. <div{{ attributes.addClass(classes) }}>
  31. {% if not label_hidden %}
  32. <div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
  33. {% endif %}
  34. {% for content in contents %}
  35. <div class="gallery-cell">
  36. {{- content -}}
  37. </div>
  38. {% endfor %}
  39. </div>
  40. {% endif %}