We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Pagination won't work on dynamic URLS that have 2 segments

How Do I?

Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

Hi all,

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?

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

I’m assuming that the template is not catching the URL, I’d try setting the template’s route to:

/case-studies/{category:alpha_dash}/{page:pagination}

Require All Segments set to no.

       
Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

Hey Pedro,

I’ve just tried this, it now just makes the page blank which is a bit odd

Andy

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

I have the same exact setup working on a site.. I do have dynamic set to no. Try that and moving that route all the way to the top for testing purposes?

       
Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

That was it, set dynamic to no and it’s all good 😊

       
Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

Hi Pedro,

Thanks for your help on this one. I’ve got a similar problem here - https://ellislab.com/forums/viewthread/249174/

I’ve tried a custom route but no luck

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

I am assuming you’ve tried dynamic = “no” as well?

       
Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

Yeah I’ve tried everything above, completely stumped :/

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.