{% set paginationLimits = (resources.definition.limits) %}

<div class="product-list-pagination dropdown sylius-paginate">
    <button class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        {{ 'sylius.ui.show'|trans }} {{ resources.data.maxPerPage }}
    </button>

    <div class="dropdown-menu">
        {% for limit in paginationLimits|filter(limit => limit != resources.data.maxPerPage) %}
            {% set path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge(app.request.query.all)|merge({'limit': limit})) %}
            <a class="dropdown-item" href="{{ path }}">{{ limit }}</a>
        {% endfor %}
    </div>
</div>
