templates/front-office/partials/_pagination.html.twig line 1

Open in your IDE?
  1. {% set otherParams = "" %}
    
    {% if app.request.get('search') %}
        {% set otherParams = otherParams ~ "&search="~app.request.get('search') %}
    {% endif %}
    
    {# DESKTOP PAGINATION #}
    <div class="partial-pagination">
        <div class="pagination meli-center-center">
            {% if currentPage != 1 %}
                <div class="previous">
                    <a href="{{ app.request.pathInfo }}?page={{ currentPage-1 }}{{ otherParams }}">
                        <div class="icon"></div>
                    </a>
                </div>
            {% endif %}
    
            <div class="page-box meli-width-10 meli-center-center">
                {% for p in 1..pageTot %}
                    <div class="item">
                        <a
                                class="txt-century txt-lightGreen txt-size15{% if currentPage == p %}txt-bold{% endif %}"
                                href="{{ app.request.pathInfo }}?page={{ p }}{{ otherParams }}">{{ p }}</a>
                    </div>
                {% endfor %}
            </div>
    
    
            {% if currentPage != pageTot %}
                <div class="next">
                    <a href="{{ app.request.pathInfo }}?page={{ currentPage+1 }}{{ otherParams }}">
                        <div class="icon"></div>
                    </a>
                </div>
            {% endif %}
        </div>
    
        {# RESPONSIVE PAGINATION #}
        <div class="resp-pagination">
            <div class="meli-between-center">
                {% if currentPage != 1 %}
                    <a href="{{ app.request.pathInfo }}?page={{ currentPage-1 }}{{ otherParams }}">
                        <div class="previous">
                            <p class="txt-century txt-orange txt-bold txt-size12">
                                <span class="arrow"></span>
                                Page précédente
                            </p>
                        </div>
                    </a>
                {% else %}
                    <div></div>
                {% endif %}
    
                {% if currentPage != pageTot %}
                    <a href="{{ app.request.pathInfo }}?page={{ currentPage+1 }}{{ otherParams }}">
                        <div class="next">
                            <p class="txt-century txt-orange txt-bold txt-size12">
                                Page suivante
                                <span class="arrow"></span>
                        </div>
                    </a>
                {% endif %}
            </div>
        </div>
    
    </div>