You are here

views-mini-pager.html.twig in Drupal 10

Theme override for a views mini-pager.

Available variables:

  • heading_id: Pagination heading ID.
  • items: List of pager items.

File

core/themes/bartik/templates/classy/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. * - items: List of pager items.
  9. *
  10. * @see template_preprocess_views_mini_pager()
  11. */
  12. #}
  13. {% if items.previous or items.next %}
  14. <nav class="pager" role="navigation" aria-labelledby="{{ heading_id }}">
  15. <h4 id="{{ heading_id }}" class="pager__heading visually-hidden">{{ 'Pagination'|t }}</h4>
  16. <ul class="pager__items js-pager__items">
  17. {% if items.previous %}
  18. <li class="pager__item pager__item--previous">
  19. <a href="{{ items.previous.href }}" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'title', 'rel') }}>
  20. <span class="visually-hidden">{{ 'Previous page'|t }}</span>
  21. <span aria-hidden="true">{{ items.previous.text|default('‹‹'|t) }}</span>
  22. </a>
  23. </li>
  24. {% endif %}
  25. {% if items.current %}
  26. <li class="pager__item is-active">
  27. {% trans %}
  28. Page {{ items.current }}
  29. {% endtrans %}
  30. </li>
  31. {% endif %}
  32. {% if items.next %}
  33. <li class="pager__item pager__item--next">
  34. <a href="{{ items.next.href }}" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'title', 'rel') }}>
  35. <span class="visually-hidden">{{ 'Next page'|t }}</span>
  36. <span aria-hidden="true">{{ items.next.text|default('››'|t) }}</span>
  37. </a>
  38. </li>
  39. {% endif %}
  40. </ul>
  41. </nav>
  42. {% endif %}