Paginate an array with multiple filters I'm looking to paginate and array with multiple filters.

The current url would be: www.example.com/search?filter=shorts&amp;type=leather&amp;brand=sams

Clicking on the next next link returns: www.example.com/search/p2 effectively removing the search params.

Is there a way to paginate the full url without removing the search params?

{% paginate test.limit(4) as entries %}
    {% for entry in entriesOnPage %}
        &lt;article&gt;
            &lt;h1&gt;{{ entry.title }}&lt;/h1&gt;
            {{ entry.body }}
        &lt;/article&gt;
    {% endfor %}

    {% if paginate.prevUrl %}
        &lt;a href="{{ paginate.prevUrl }}"&gt;Previous Page&lt;/a&gt;
    {% endif %}

    {% if paginate.nextUrl %}
        &lt;a href="{{ paginate.nextUrl }}"&gt;Next Page&lt;/a&gt;
    {% endif %}
{% endpaginate %}
Try using this (completely untested):

{% if paginate.prevUrl %}
    &lt;a href="{{ paginate.prevUrl }}?{{ craft.request.getQueryStringWithoutPath() }}"&gt;Previous Page&lt;/a&gt;
{% endif %}

{% if paginate.nextUrl %}
    &lt;a href="{{ paginate.nextUrl }}?{{ craft.request.getQueryStringWithoutPath() }}"&gt;Next Page&lt;/a&gt;
{% endif %}


Update:

The above will only work once Craft 2.3 comes out.

In the meantime, it's a bit sketchy, but you can open up craft/app/variables/HttpRequestVariable.php and add this method:

public function getQueryStringWithoutPath()
{
    return craft()-&gt;request-&gt;getQueryStringWithoutPath();
}


And it should work.  But please be aware that file could be overwritten by a 2.2 build release at any point during an auto-update and your template would break.