I use Content Taxonomy and Hierarchical Select for "Address" vocabulary, which contains 3 levels: City - District - Street.
I need to use City name in node url using pathauto, so I use pattern like [field_address-term]/[field_type-term]/[title]. As I understand it, [field_address-term] should return city name (top term in my vocabulary), but it returns street name, which is the deepest term.
Also there is a problem with $tokens['terms-raw'] - it returns text liike "Street, District, City" instead of "City, District, Street".
I solved the problem patching content_taxonomy.token.inc (the patch is attached). I just added array_reverse() function to change the order of terms, and it works fine for me. But I guess it would be nice to have both variants of tokes - with normal and reverse order, or to get to user chance to choose the order in the settings.
| Comment | File | Size | Author |
|---|---|---|---|
| content_taxonomy.token_.inc_.patch | 449 bytes | quotesbro |
Comments
Comment #1
steve.hartley commentedMany thanks for this!
Comment #2
nodecode commentedI second the need for this. From my limited experience, the so called "top term" token is also totally backwards in 6.x-1.0-rc2 just as described here. Using dberror's example, I expect this token to return the City name but instead the token returns a lower (deeper) level Street name instead.
Does any one know if this has been or can be committed to dev?
Comment #3
JCB commentedI concur.
Will you guys please come up with a concrete solution for this?
Add a new token which gives the correct order of hierarchy.
One can then use which ever token one want for the specific purpose.