2

I think that I need to set up a few routes to handle my category based RSS feeds. I have a current url structure as follows

http://something.com/shows/wmr/marketing pr

http://something.com/categoryGroup/parentCategory/childCategory

I need rss feeds from both the parent and child categories

http://something.com/categoryGroup/parentCategory/feed
http://something.com/categoryGroup/parentCategory/childCategory/feed

The rss template i am using is stored in

categories/_shows.rss

I have munged something together in the cp routes settings but I would prefer to have this in routes.php. Having access to the parentCategory and childCategory values without doing a segments thing would be nice.

1

Okay, I think that I have figured it out. Posting here for posterity. Based on the requirement above, I put these in my routes.php file.

'shows\/(?P<parentSlug>[a-zA-Z0-9\-\.]+)\/(?P<childSlug>[a-zA-Z0-9\-\.]+)\/feed' => 'categories/_shows.rss',

and

'shows\/(?P<parentSlug>[a-zA-Z0-9\-\.]+)\/feed' => 'categories/_shows.rss',

This gives me two variables. parentSlug and childSlug

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.