You are here

pagination.html.twig in Simple Style Guide 8

<a name="pagination"></a>

<h3 class="simple-styleguide--sectionhead">{{ default_pattern }}</h3>

<div class="simple-styleguide">

    <p><strong>Full Pager:</strong></p>
    <nav class="pager" role="navigation" aria-labelledby="pagination-heading">
        <h4 id="pagination-heading" class="visually-hidden">Pagination</h4>
        <ul class="pager__items js-pager__items">
            <li class="pager__item is-active">
                <a href="?page=0" title="Current page"><span class="visually-hidden">Current page</span>1</a>
            </li>
            <li class="pager__item">
                <a href="?page=1" title="Go to page 2"><span class="visually-hidden">Page</span>2</a>
            </li>
            <li class="pager__item">
                <a href="?page=2" title="Go to page 3"><span class="visually-hidden">Page</span>3</a>
            </li>
            <li class="pager__item">
                <a href="?page=3" title="Go to page 4"><span class="visually-hidden">Page</span>4</a>
            </li>
            <li class="pager__item pager__item--ellipsis" role="presentation">
                …
            </li>
            <li class="pager__item pager__item--next">
                <a href="?page=1" title="Go to next page" rel="next">
                    <span class="visually-hidden">Next page</span>
                    <span aria-hidden="true">Next ›</span>
                </a>
            </li>
            <li class="pager__item pager__item--last">
                <a href="?page=19" title="Go to last page">
                    <span class="visually-hidden">Last page</span>
                    <span aria-hidden="true">Last »</span>
                </a>
            </li>
        </ul>
    </nav>

    <p><strong>Mini Pager:</strong></p>
    <nav class="pager" role="navigation" aria-labelledby="pagination-heading">
        <h4 class="pager__heading visually-hidden">Pagination</h4>
        <ul class="pager__items js-pager__items">
            <li class="pager__item pager__item--previous">
                <a href="/local-eats?page=0" title="Go to previous page" rel="prev">
                    <span class="visually-hidden">Previous page</span>
                    <span aria-hidden="true">‹ Previous</span>
                </a>
            </li>
            <li class="pager__item is-active">
                Page 2
            </li>
            <li class="pager__item pager__item--next">
                <a href="/local-eats?page=2" title="Go to next page" rel="next">
                    <span class="visually-hidden">Next page</span>
                    <span aria-hidden="true">Next ›</span>
                </a>
            </li>
        </ul>
    </nav>
</div>

File

templates/includes/pagination.html.twig
View source
  1. <a name="pagination"></a>
  2. <h3 class="simple-styleguide--sectionhead">{{ default_pattern }}</h3>
  3. <div class="simple-styleguide">
  4. <p><strong>Full Pager:</strong></p>
  5. <nav class="pager" role="navigation" aria-labelledby="pagination-heading">
  6. <h4 id="pagination-heading" class="visually-hidden">Pagination</h4>
  7. <ul class="pager__items js-pager__items">
  8. <li class="pager__item is-active">
  9. <a href="?page=0" title="Current page"><span class="visually-hidden">Current page</span>1</a>
  10. </li>
  11. <li class="pager__item">
  12. <a href="?page=1" title="Go to page 2"><span class="visually-hidden">Page</span>2</a>
  13. </li>
  14. <li class="pager__item">
  15. <a href="?page=2" title="Go to page 3"><span class="visually-hidden">Page</span>3</a>
  16. </li>
  17. <li class="pager__item">
  18. <a href="?page=3" title="Go to page 4"><span class="visually-hidden">Page</span>4</a>
  19. </li>
  20. <li class="pager__item pager__item--ellipsis" role="presentation">
  21. </li>
  22. <li class="pager__item pager__item--next">
  23. <a href="?page=1" title="Go to next page" rel="next">
  24. <span class="visually-hidden">Next page</span>
  25. <span aria-hidden="true">Next ›</span>
  26. </a>
  27. </li>
  28. <li class="pager__item pager__item--last">
  29. <a href="?page=19" title="Go to last page">
  30. <span class="visually-hidden">Last page</span>
  31. <span aria-hidden="true">Last »</span>
  32. </a>
  33. </li>
  34. </ul>
  35. </nav>
  36. <p><strong>Mini Pager:</strong></p>
  37. <nav class="pager" role="navigation" aria-labelledby="pagination-heading">
  38. <h4 class="pager__heading visually-hidden">Pagination</h4>
  39. <ul class="pager__items js-pager__items">
  40. <li class="pager__item pager__item--previous">
  41. <a href="/local-eats?page=0" title="Go to previous page" rel="prev">
  42. <span class="visually-hidden">Previous page</span>
  43. <span aria-hidden="true">‹ Previous</span>
  44. </a>
  45. </li>
  46. <li class="pager__item is-active">
  47. Page 2
  48. </li>
  49. <li class="pager__item pager__item--next">
  50. <a href="/local-eats?page=2" title="Go to next page" rel="next">
  51. <span class="visually-hidden">Next page</span>
  52. <span aria-hidden="true">Next ›</span>
  53. </a>
  54. </li>
  55. </ul>
  56. </nav>
  57. </div>