You are here

views-bootstrap-list-group.html.twig in Views Bootstrap 8.4

Same filename and directory in other branches
  1. 8.3 templates/views-bootstrap-list-group.html.twig

views-bootstrap-list-group.html.twig Default simple view template to display Bootstrap List Group.

Available variables:

  • view: The view object.
  • rows: A list of the view's row items.
  • id: A valid HTML ID and guaranteed to be unique.

File

templates/views-bootstrap-list-group.html.twig
View source
  1. {#
  2. /**
  3. * @file views-bootstrap-list-group.html.twig
  4. * Default simple view template to display Bootstrap List Group.
  5. *
  6. * Available variables:
  7. * - view: The view object.
  8. * - rows: A list of the view's row items.
  9. * - id: A valid HTML ID and guaranteed to be unique.
  10. *
  11. * @see template_preprocess_views_bootstrap_list_group()
  12. *
  13. * @ingroup views_templates
  14. */
  15. #}
  16. {%
  17. set classes = [
  18. 'views-view-list-group',
  19. ]
  20. %}
  21. <ul id="{{ id }}" {{ attributes.addClass(classes) }}>
  22. {% for key, row in rows %}
  23. <li class="list-group-item">
  24. {% if row.title %}
  25. <h4 class="list-group-item-heading">{{ row.title }}</h4>
  26. {% endif %}
  27. <p class="list-group-item-text">{{ row.content }}</p>
  28. </li>
  29. {% endfor %}
  30. </ul>