0

I’m building a site that has the following URI structures:

domain.com/case-studies - this page loads ALL case studies and pagination works fine as there is only one segment.

domain.com/case-studies/residential - this uses seg2cat on category_2 to load the case studies for residential. If there are more than 6, I click the next page and get the URI domain.com/case-studies/residential/P6

This TOTALLY breaks the page and I get “Error, The page your requested was not found”

Here is the pagination code I’m using:

{exp:channel:entries channel="case_study" category="{segment_2_category_id}” orderby=”date” sort=”desc” paginate=”bottom” limit=”6” dynamic=”yes”}

{paginate} <nav> <ul class=”pager”> {if previous_page} <li class=”previous”>← Older</li> {/if} {if next_page} <li class=”next”>Newer →</li> {/if} </ul> </nav> {/paginate}

I’m totally stuck, can anyone help at all?

  • dynamic="no" maybe? – Jelle Dijkstra Jul 6 '16 at 12:18
  • @JelleDijkstra Haha, first thing I always try. Turns out I had to set a custom template route AND set dynamic to no – Andy Holmes Jul 6 '16 at 12:32
1

In order for this to work, I had to set my channel entries tag to dynamic="no" and also set a custom template route for my Case Studies template like this /case-studies/{category:alpha_dash}/{page:pagination}

Works fine!

Andy

| improve this answer | |
  • Can you explain what you had to do in a little more detail in regards to your template route. I think im having a similar issue. I dont get an error, but my pagination links to a blank page(all black). In your template route, how do you check for a pagination page since the pagination URL title won't always be the same (p2/p4/p6. ect). Please and thank you. – Myron Aug 17 '16 at 20:11
  • What's your template route you're using? @Myron – Andy Holmes Aug 17 '16 at 22:05

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.