You are here

views-bootstrap-cards.html.twig in Views Bootstrap 8.3

Same filename and directory in other branches
  1. 8.4 templates/views-bootstrap-cards.html.twig

views-bootstrap-cards.html.twig Default simple view template to display Bootstrap Cards.

  • rows: Contains a nested array of rows. Each row contains an array of columns.

File

templates/views-bootstrap-cards.html.twig
View source
  1. {#
  2. /**
  3. * @file views-bootstrap-cards.html.twig
  4. * Default simple view template to display Bootstrap Cards.
  5. *
  6. *
  7. * - rows: Contains a nested array of rows. Each row contains an array of
  8. * columns.
  9. *
  10. * @ingroup views_templates
  11. */
  12. #}
  13. {{ attach_library('views_bootstrap/cards') }}
  14. <div {{ attributes.addClass(classes) }}>
  15. {% for key, row in rows -%}
  16. <div {{ row.attributes.addClass(classes) }}>
  17. {# Show image #}
  18. {% if row.image %}
  19. {{ row.image }}
  20. {% endif %}
  21. {% if row.title %}
  22. <div class="card-header">{{ row.title }}</div>
  23. {% endif %}
  24. {% if row.content %}
  25. <div class="card-body">
  26. {{ row.content }}
  27. </div>
  28. {% endif %}
  29. </div>
  30. {%- endfor %}
  31. </div>