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.
  • row_classes: HTML classes to apply to each row, indexed by row ID. This matches the index in rows.
  • 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()

template_preprocess_views_view_summary()

File

drupal/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. * - row_classes: HTML classes to apply to each row, indexed by row ID.
  13. * This matches the index in rows.
  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()
  19. * @see template_preprocess_views_view_summary()
  20. *
  21. * @ingroup themeable
  22. */
  23. #}
  24. <div class="item-list">
  25. <ul class="views-summary">
  26. {% for id, row in rows %}
  27. <li><a href="{{ row.url }}"{{ row_classes[id] }}>{{ row.link }}</a>
  28. {% if options.count %}
  29. ({{ row.count }})
  30. {% endif %}
  31. </li>
  32. {% endfor %}
  33. </ul>
  34. </div>

Related topics