tablesort-indicator.html.twig

Same filename in this branch
  1. 11.x core/themes/claro/templates/admin/tablesort-indicator.html.twig
  2. 11.x core/modules/system/templates/tablesort-indicator.html.twig
Same filename and directory in other branches
  1. 9 core/themes/stable9/templates/admin/tablesort-indicator.html.twig
  2. 9 core/themes/claro/templates/admin/tablesort-indicator.html.twig
  3. 9 core/themes/stable/templates/admin/tablesort-indicator.html.twig
  4. 9 core/modules/system/templates/tablesort-indicator.html.twig
  5. 8.9.x core/themes/claro/templates/admin/tablesort-indicator.html.twig
  6. 8.9.x core/themes/stable/templates/admin/tablesort-indicator.html.twig
  7. 8.9.x core/modules/system/templates/tablesort-indicator.html.twig
  8. 10 core/themes/stable9/templates/admin/tablesort-indicator.html.twig
  9. 10 core/themes/claro/templates/admin/tablesort-indicator.html.twig
  10. 10 core/modules/system/templates/tablesort-indicator.html.twig

Theme override for displaying a tablesort indicator.

Available variables:

  • style: Either 'asc' or 'desc', indicating the sorting direction.
2 theme calls to tablesort-indicator.html.twig
TableSort::header in core/lib/Drupal/Core/Utility/TableSort.php
Formats a column header.
template_preprocess_views_view_table in core/modules/views/views.theme.inc
Prepares variables for views table templates.

File

core/themes/stable9/templates/admin/tablesort-indicator.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for displaying a tablesort indicator.
  5. *
  6. * Available variables:
  7. * - style: Either 'asc' or 'desc', indicating the sorting direction.
  8. */
  9. #}
  10. {%
  11. set classes = [
  12. 'tablesort',
  13. 'tablesort--' ~ style,
  14. ]
  15. %}
  16. <span{{ attributes.addClass(classes) }}>
  17. <span class="visually-hidden">
  18. {% if style == 'asc' -%}
  19. {{ 'Sort ascending'|t }}
  20. {% else -%}
  21. {{ 'Sort descending'|t }}
  22. {% endif %}
  23. </span>
  24. </span>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.