1

Is it possible to use a page query parameter for paginating entries with {% paginate %} instead of a dynamic segment?

So instead of http://example.com/articles/p2 i would like to use http://example.com/articles?page=2.

This would simplify interoperability with client side MVC frameworks because the query parameter would be clearly separated from a dynamic route for a single entry in articles (i.e. http://example.com/articles/a-single-article).

The only solution I can think of at the moment is to not use {% paginate %} altogether and instead calculate limit and offset for craft.entries.find(...) manually from craft.request.getQuery("page"). I hope there is an easier way?

  • Unfortunately, the pageTrigger setting just changes the segment. Looking at Craft's source, as best I can tell the segments are the only thing that can be used with the built in paginate tags. Christian, were you able to figure something out? I hesitate to resort to writing a bunch of custom code to read/update craft.request. – Janson Hartliep Apr 2 '15 at 17:50
3

I think this is what are you searching for:

http://buildwithcraft.com/docs/config-settings#pageTrigger

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.