Closed (fixed)
Project:
Pathauto
Version:
7.x-1.2
Component:
Tokens
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Mar 2013 at 16:14 UTC
Updated:
2 Oct 2015 at 19:12 UTC
Jump to comment: Most recent
Given that the tokens available for use in Pathauto patterns appear to have changed radically, is there any equivalent to the very useful catpath pattern from D6? I don't see anything that looks similar...
The nearest equivalent I can see would be to assemble it by putting together [term:parents:join-path] and [term:name] separated by a slash, but wouldn't that lead to a double slash in the URL if some terms didn't have any parents? Or would Pathauto automatically correct for that?
Comments
Comment #1
fengtanMaybe you can use
[term:parents:join-path]/[term:name]in D7 where you used[catpath]in D6.Pathauto trims duplicate separators in
pathauto_clean_alias()anyway, so you should not end up with double slashes in the URL.Comment #2
kenorb commentedThe same problem here:
It seem pathauto wrongly converting term:catpath from D6 into term:name in hook_update
breaking the consistency of old paths.
I've tried [term:parents-all] and [term:parent:parents:join-path], but it seems it doesn't work as expected.
See the comment from token_node.inc:
Comment #3
kenorb commentedBy applying drush support for Pathauto at #867578: Add drush commands for bulk alias updating/deleting you may quickly test what could be suitable for you, e.g.:
Try also:
[term:parent:parents:join-path], [term:vocabulary]/[term:parent:parents:reversed:join-path]/[term:name], but these doesn't work for me, are empty.
Comment #4
kenorb commentedThe best token I've found equivalent to:
is:
Comment #5
dave reidActually [term:parents:all:join-path]/[term:name] is the direct replacement for [catpath-raw].
Comment #6
kenorb commentedI'm not sure, because [term:parents:all:join-path]/[term:name] doesn't work for me as a Forum pattern.
it generates the aliases like:
and it looks like token is ignored or empty.
When using
it generates the aliases like:
Comment #7
dave reidAck, sorry that's my fault. The token is actually
[term:parents:join-path].Comment #8
kenorb commentedYes, it works, thank you.
Comment #10
summit commentedHi thanks, this helped. I needed:
greetings,
Martijn