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

Template routes with categories & pagination

How Do I?

The Design Core's avatar
The Design Core
348 posts
7 years ago
The Design Core's avatar The Design Core

I’m having trouble getting my template routes to work with pagination & categories.

I have a basic blog which I’ve set up a route to remove the detail page name from the URL, so instead of http://www.mywebsite.com/blog/detail/entry-title-here, I have http://www.mywebsite.com/blog/entry-title-here.

I am using the following template route: /blog/{post:alpha_dash}

This works fine and categories also work fine. But when introducing pagination to the mix, I can’t seem to get pagination to work. Pagination URLs display nothing on the page.

I have segments required set to No. Running EE v 4.2.1.

What do I need to do to get pagination working?

Thanks for any help.

       
James Mathias's avatar
James Mathias
225 posts
7 years ago
James Mathias's avatar James Mathias

Hi,

Here is how we remove the “detail” template from the URL in ExpressionEngine, with the template set up you describe.

/blog/{url_title:regex[(((?!(P\d+|category\/)).)+?)]}

You’ll want to replace category with the actual category separator word you have defined in your CP.

       
The Design Core's avatar
The Design Core
348 posts
7 years ago
The Design Core's avatar The Design Core

Thank you so much! Works like a charm!

       

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.