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/olivero/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. * - 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="visually-hidden">{{ 'Pagination'|t }}</h4>
  16. <ul class="pager__items js-pager__items">
  17. {# Print previous item if we are not on the first page. #}
  18. {% if items.previous %}
  19. {% apply spaceless %}
  20. <li class="pager__item pager__item--control pager__item--previous">
  21. <a href="{{ items.previous.href }}" class="pager__link" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'title', 'rel', 'class') }}>
  22. <span class="visually-hidden">{{ 'Previous page'|t }}</span>
  23. {% include "@olivero/../images/pager-previous.svg" %}
  24. </a>
  25. </li>
  26. {% endapply %}
  27. {% endif %}
  28. {# Print current active page. #}
  29. {% if items.current %}
  30. <li class="pager__item pager__item--active">
  31. {{ items.current }}
  32. </li>
  33. {% endif %}
  34. {# Print next item if we are not on the last page. #}
  35. {% if items.next %}
  36. {% apply spaceless %}
  37. <li class="pager__item pager__item--control pager__item--next">
  38. <a href="{{ items.next.href }}" class="pager__link" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'title', 'rel') }}>
  39. <span class="visually-hidden">{{ 'Next page'|t }}</span>
  40. {% include "@olivero/../images/pager-previous.svg" %}
  41. </a>
  42. </li>
  43. {% endapply %}
  44. {% endif %}
  45. </ul>
  46. </nav>
  47. {% endif %}