views-mini-pager.html.twig 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a views mini-pager.
  5. *
  6. * Available variables:
  7. * - items: List of pager items.
  8. *
  9. * @see template_preprocess_views_mini_pager()
  10. */
  11. #}
  12. {% if items.previous or items.next %}
  13. <nav class="pager" role="navigation" aria-labelledby="pagination-heading">
  14. <h4 class="pager__heading visually-hidden">{{ 'Pagination'|t }}</h4>
  15. <ul class="pager__items js-pager__items">
  16. {% if items.previous %}
  17. <li class="pager__item pager__item--previous">
  18. <a href="{{ items.previous.href }}" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'title', 'rel') }}>
  19. <span class="visually-hidden">{{ 'Previous page'|t }}</span>
  20. <span aria-hidden="true">{{ items.previous.text|default('‹‹'|t) }}</span>
  21. </a>
  22. </li>
  23. {% endif %}
  24. {% if items.current %}
  25. <li class="pager__item is-active">
  26. {% trans %}
  27. Page {{ items.current }}
  28. {% endtrans %}
  29. </li>
  30. {% endif %}
  31. {% if items.next %}
  32. <li class="pager__item pager__item--next">
  33. <a href="{{ items.next.href }}" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'title', 'rel') }}>
  34. <span class="visually-hidden">{{ 'Next page'|t }}</span>
  35. <span aria-hidden="true">{{ items.next.text|default('››'|t) }}</span>
  36. </a>
  37. </li>
  38. {% endif %}
  39. </ul>
  40. </nav>
  41. {% endif %}