Jump to content

URL segments vs matching tree path


xu_phann
 Share

Recommended Posts

I'd pluralize category -> categories and display a list of categories with 3-4 posts under each category. Then you can display a category under /categories/processwire or use urlSegments to rename that to /category/processwire.

Or just render category list at /categories with urlSegments and redirect /category to /categories. 

What I normally do is keep categories under /blog/categories/. Everything works just fine with no need for urlSegments.

One handy tool when using urlSegments is to hook into Page::path and modify $event->return, so you won't have to manually building urls everywhere you need. You still need to implement urlSegment logic though, changing Page::path is a passive operation, it doesnt change routing behavior

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...