How to keep all $_GET variables when using tailor pagination

Hello,

I use $_GET[‘q’] variable to filters tailor collection. Everythings works fine here.

My problem is when I want to display pagination for that collection, I use this syntax :

{{ posts.links|raw }}

The pagination is displayed correctly, but the generated links don’t keep my $GET[‘q’] value, so, when I paginate results, I lose my filter.

My question is : How can I keep my $_GET[‘q’] value in my pagination ?

Best regards,

Hi @PubliAlex

The demo theme does it like this (pages/blog/search.htm):

{{ posts.appends(get()).links|raw }}

I hope this helps.

Thank you @daft, this is what I need.

Could this example be integrated in the doc ? It’s a quite common need and I had trouble finding the information.

Best regards,