Same filename in this branch
  1. 10 core/modules/views/templates/views-view-summary.html.twig
  2. 10 core/themes/stable9/templates/views/views-view-summary.html.twig
  3. 10 core/themes/starterkit_theme/templates/views/views-view-summary.html.twig
  4. 10 core/themes/claro/templates/classy/views/views-view-summary.html.twig
  5. 10 core/profiles/demo_umami/themes/umami/templates/classy/views/views-view-summary.html.twig
Same filename and directory in other branches
  1. 8.9.x core/modules/views/templates/views-view-summary.html.twig
  2. 9 core/modules/views/templates/views-view-summary.html.twig

Default theme implementation to display a list of summary lines.

Available variables:

  • rows: The rows contained in this view. Each row contains:

    • url: The summary link URL.
    • link: The summary link text.
    • count: The number of items under this grouping.
    • attributes: HTML attributes to apply to each row.
    • active: A flag indicating whether the row is active.
  • options: Flags indicating how the summary should be displayed. This contains:

    • count: A flag indicating whether the count should be displayed.

See also

template_preprocess_views_view_summary()

File

core/modules/views/templates/views-view-summary.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a list of summary lines.
  5. *
  6. * Available variables:
  7. * - rows: The rows contained in this view.
  8. * Each row contains:
  9. * - url: The summary link URL.
  10. * - link: The summary link text.
  11. * - count: The number of items under this grouping.
  12. * - attributes: HTML attributes to apply to each row.
  13. * - active: A flag indicating whether the row is active.
  14. * - options: Flags indicating how the summary should be displayed.
  15. * This contains:
  16. * - count: A flag indicating whether the count should be displayed.
  17. *
  18. * @see template_preprocess_views_view_summary()
  19. *
  20. * @ingroup themeable
  21. */
  22. #}
  23. <ul>
  24. {% for row in rows %}
  25. <li><a href="{{ row.url }}"{{ row.attributes.addClass(row.active ? 'is-active')|without('href') }}>{{ row.link }}</a>
  26. {% if options.count %}
  27. ({{ row.count }})
  28. {% endif %}
  29. </li>
  30. {% endfor %}
  31. </ul>

Related topics