views-mini-pager.html.twig

Same filename in this branch
  1. 11.x core/profiles/demo_umami/themes/umami/templates/classy/views/views-mini-pager.html.twig
  2. 11.x core/themes/olivero/templates/views/views-mini-pager.html.twig
  3. 11.x core/themes/stable9/templates/views/views-mini-pager.html.twig
  4. 11.x core/themes/starterkit_theme/templates/views/views-mini-pager.html.twig
  5. 11.x core/modules/views/templates/views-mini-pager.html.twig
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/templates/classy/views/views-mini-pager.html.twig
  2. 9 core/themes/olivero/templates/views/views-mini-pager.html.twig
  3. 9 core/themes/stable9/templates/views/views-mini-pager.html.twig
  4. 9 core/themes/seven/templates/classy/views/views-mini-pager.html.twig
  5. 9 core/themes/claro/templates/views/views-mini-pager.html.twig
  6. 9 core/themes/bartik/templates/classy/views/views-mini-pager.html.twig
  7. 9 core/themes/stable/templates/views/views-mini-pager.html.twig
  8. 9 core/themes/starterkit_theme/templates/views/views-mini-pager.html.twig
  9. 9 core/themes/classy/templates/views/views-mini-pager.html.twig
  10. 9 core/modules/views/templates/views-mini-pager.html.twig
  11. 8.9.x core/profiles/demo_umami/themes/umami/templates/classy/views/views-mini-pager.html.twig
  12. 8.9.x core/themes/seven/templates/classy/views/views-mini-pager.html.twig
  13. 8.9.x core/themes/claro/templates/views/views-mini-pager.html.twig
  14. 8.9.x core/themes/bartik/templates/classy/views/views-mini-pager.html.twig
  15. 8.9.x core/themes/stable/templates/views/views-mini-pager.html.twig
  16. 8.9.x core/themes/classy/templates/views/views-mini-pager.html.twig
  17. 8.9.x core/modules/views/templates/views-mini-pager.html.twig
  18. 10 core/profiles/demo_umami/themes/umami/templates/classy/views/views-mini-pager.html.twig
  19. 10 core/themes/olivero/templates/views/views-mini-pager.html.twig
  20. 10 core/themes/stable9/templates/views/views-mini-pager.html.twig
  21. 10 core/themes/claro/templates/views/views-mini-pager.html.twig
  22. 10 core/themes/starterkit_theme/templates/views/views-mini-pager.html.twig
  23. 10 core/modules/views/templates/views-mini-pager.html.twig

Theme override for a views mini-pager.

Available variables:

  • heading_id: Pagination heading ID.
  • pagination_heading_level: The heading level to use for the pager.
  • items: List of pager items.

See also

template_preprocess_views_mini_pager()

File

core/themes/claro/templates/views/views-mini-pager.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a views mini-pager.
  5. *
  6. * Available variables:
  7. * - heading_id: Pagination heading ID.
  8. * - pagination_heading_level: The heading level to use for the pager.
  9. * - items: List of pager items.
  10. *
  11. * @see template_preprocess_views_mini_pager()
  12. */
  13. #}
  14. {%
  15. set pager_action_classes = [
  16. 'pager__link',
  17. 'pager__link--mini',
  18. 'pager__link--action-link'
  19. ]
  20. %}
  21. {% if items.previous or items.next %}
  22. <nav{{ attributes.addClass('pager').setAttribute('role', 'navigation').setAttribute('aria-labelledby', heading_id) }}>
  23. <{{ pagination_heading_level }} id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</{{ pagination_heading_level }}>
  24. <ul{{ content_attributes.addClass('pager__items', 'js-pager__items') }}>
  25. {% if items.previous %}
  26. {% apply spaceless %}
  27. <li class="pager__item pager__item--mini pager__item--action pager__item--previous">
  28. <a{{ items.previous.attributes.addClass(pager_action_classes).setAttribute('title', 'Go to previous page'|t).setAttribute('href', items.previous.href) }}>
  29. <span class="visually-hidden">{{ 'Previous page'|t }}</span>
  30. </a>
  31. </li>
  32. {% endapply %}
  33. {% endif %}
  34. {% if items.current %}
  35. <li class="pager__item pager__item--mini pager__item--current">
  36. <span class="visually-hidden">
  37. {{ 'Current page'|t }}
  38. </span>
  39. {{ items.current }}
  40. </li>
  41. {% endif %}
  42. {% if items.next %}
  43. {% apply spaceless %}
  44. <li class="pager__item pager__item--mini pager__item--action pager__item--next">
  45. <a{{ items.next.attributes.addClass(pager_action_classes).setAttribute('title', 'Go to next page'|t).setAttribute('href', items.next.href) }}>
  46. <span class="visually-hidden">{{ 'Next page'|t }}</span>
  47. </a>
  48. </li>
  49. {% endapply %}
  50. {% endif %}
  51. </ul>
  52. </nav>
  53. {% endif %}

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