Andy Holmes Andy Holmes - 1 year ago 104
PHP Question

ExpressionEngine Pagination issue with 2 segments

I’m building a site that has the following URI structures: - this page loads ALL case studies and pagination works fine as there is only one segment. - 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

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?

Answer Source

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!


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download