Hello,

I have a bit of a problem with pathauto and [categorypathfirst]. I have the following category structure for classified posts:
Country
- US
State (distant parent: Country)
- California (parent: US)
City (distant parent: State)
- Berkeley (parent: California)

I would like the post URL to look like this: country/us/california/berkeley/post

But when I use [categorypathfirst], it picks up the lightest category, which is US, so I get URL like this:
country/us/post

Is there a way to make an alternative to [categorypathfirst]? Maybe [categorypaththird]?

Any ideas?

Thanks,
Andrey.

Comments

mr.andrey’s picture

Or maybe [categorypathfirst] can be manually overwritten to pick up the heaviest category, thus picking up it's tree?

It makes more sense this way - getting Berkeley would get all of it's parents. Putting the categories in reverse to pick up the lightest doesn't make sense - country/state/city have to be in that order.

Can anyone point me in a direction of where I can change that?

Thanks,
Andrey.