{# default Sliding pagination control implementation #}
{% if pageCount > 1 %}
<ul class="pagination">
{% if previous is defined %}
<li>
{% if previous == 1 %}
{% set newArr = [] %}
{% for key, element in query %}
{% if key != 'page' %}
{% set newArr = newArr|merge({(key): element}) %}
{% endif %}
{% endfor %}
<a rel="prev" href="{{ path(route, newArr) }}"><i class="fa fa-angle-left"></i></a>
{% else %}
{% set nextCustom = current + 1 %}
{% set previousCustom = current - 1 %}
<a {% if nextCustom == previous %}rel="next"{% endif %} {% if previousCustom == previous %}rel="prev"{% endif %} href="{{ path(route, query|merge({(pageParameterName): previous})) }}"><i class="fa fa-angle-left"></i></a>
{% endif %}
</li>
{% endif %}
{% for page in pagesInRange %}
{% if page != current %}
<li>
{% if page == 1 %}
{% set newArr = [] %}
{% for key, element in query %}
{% if key != 'page' %}
{% set newArr = newArr|merge({(key): element}) %}
{% endif %}
{% endfor %}
<a href="{{ path(route, newArr) }}">{{ page }}</a>
{% else %}
{% set next = current + 1 %}
{% set previous = current - 1 %}
<a {% if next == page %}rel="next"{% endif %} {% if previous == page %}rel="prev"{% endif %} href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
{% endif %}
</li>
{% else %}
<li>
<a class="current" style="font-weight: bold;" href="javascript:;">
{{ page }}
</a>
</li>
{% endif %}
{% endfor %}
{% if next is defined %}
<li>
<a rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">
<i class="fa fa-angle-right"></i>
</a>
</li>
{% endif %}
</ul>
{% endif %}