views-mini-pager.html.twig 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation 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. * @ingroup themeable
  13. */
  14. #}
  15. {% if items.previous or items.next %}
  16. <nav role="navigation" aria-labelledby="{{ heading_id }}" class="pagination">
  17. <h4 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h4>
  18. <ul class="js-pager__items">
  19. {% if items.previous %}
  20. <li>
  21. <a href="{{ items.previous.href }}" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'title', 'rel') }}>
  22. <span class="visually-hidden">{{ 'Previous page'|t }}</span>
  23. <span aria-hidden="true">{{ items.previous.text|default('‹‹'|t) }}</span>
  24. </a>
  25. </li>
  26. {% endif %}
  27. {% if items.current %}
  28. <li>
  29. {% trans %}
  30. Page {{ items.current }}
  31. {% endtrans %}
  32. </li>
  33. {% endif %}
  34. {% if items.next %}
  35. <li>
  36. <a href="{{ items.next.href }}" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'title', 'rel') }}>
  37. <span class="visually-hidden">{{ 'Next page'|t }}</span>
  38. <span aria-hidden="true">{{ items.next.text|default('››'|t) }}</span>
  39. </a>
  40. </li>
  41. {% endif %}
  42. </ul>
  43. </nav>
  44. {% endif %}