New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Use routes instead of query strings for pagination

Jeremy Hoover September 17, 2021 by Jeremy Hoover

I have a blog with paginated pages for post listings, ie:

  • /blog?page=2
  • /blog?page=3

I'd like to switch to full static caching, but ignore query strings. Which means I have to change these get params to routes, ie:

  • /blog/page-2
  • /blog/page-3

What's the best approach?

  1. Build a controller and use pagination?
  2. Would Statamic play well with the Laravel pagination package?
>>>>>>> Unanswered <<<<<<<
1 Reply
4 Followers