You are here

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

Same filename and directory in other branches
  1. 8.3 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. <div class="card-group">
  14. {% for key, row in rows -%}
  15. <div class="card">
  16. {# Show image #}
  17. {% if row.image %}
  18. {{ row.image }}
  19. {% endif %}
  20. {% if row.title %}
  21. <div class="card-header">{{ row.title }}</div>
  22. {% endif %}
  23. {% if row.content %}
  24. <div class="card-body">
  25. {{ row.content }}
  26. </div>
  27. {% endif %}
  28. </div>
  29. {%- endfor %}
  30. </div>