templates/themes/base/common/pagination.html.twig line 1

Open in your IDE?
  1. {% if pageCount > 1 %}
  2. <ul class="pagination">
  3. {% if previous is defined %}
  4. <li>
  5. <a
  6. rel="prev"
  7. href="{{ path(route, query|merge({(pageParameterName): previous})) }}"
  8. >&laquo;&nbsp;{{ 'Previous' | trans -}}
  9. </a>
  10. </li>
  11. {% else %}
  12. <li class="disabled">
  13. <span>&laquo;&nbsp;{{ 'Previous' | trans }}</span>
  14. </li>
  15. {% endif %}
  16. {% if startPage > 1 %}
  17. <li>
  18. <a href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
  19. </li>
  20. {% if startPage == 3 %}
  21. <li>
  22. <a href="{{ path(route, query|merge({(pageParameterName): 2})) }}"
  23. >2</a
  24. >
  25. </li>
  26. {% elseif startPage != 2 %}
  27. <li class="disabled">
  28. <span>&hellip;</span>
  29. </li>
  30. {% endif %}
  31. {% endif %}
  32. {% for page in pagesInRange %}
  33. {% if page != current %}
  34. <li>
  35. <a href="{{ path(route, query|merge({(pageParameterName): page})) }}">
  36. {{- page -}}
  37. </a>
  38. </li>
  39. {% else %}
  40. <li class="active">
  41. <span>{{ page }}</span>
  42. </li>
  43. {% endif %}
  44. {% endfor %}
  45. {% if pageCount > endPage %}
  46. {% if pageCount > (endPage + 1) %}
  47. {% if pageCount > (endPage + 2) %}
  48. <li class="disabled">
  49. <span>&hellip;</span>
  50. </li>
  51. {% else %}
  52. <li>
  53. <a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">
  54. {{- pageCount -1 -}}
  55. </a>
  56. </li>
  57. {% endif %}
  58. {% endif %}
  59. <li>
  60. <a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">
  61. {{- pageCount -}}
  62. </a>
  63. </li>
  64. {% endif %}
  65. {% if next is defined %}
  66. <li>
  67. <a
  68. rel="next"
  69. href="{{ path(route, query|merge({(pageParameterName): next})) }}"
  70. >
  71. {{- 'Next' | trans }}&nbsp;&raquo;</a
  72. >
  73. </li>
  74. {% else %}
  75. <li class="disabled">
  76. <span>{{ 'Next' | trans }}&nbsp;&raquo;</span>
  77. </li>
  78. {% endif %}
  79. </ul>
  80. {% endif %}