I downloaded the Pathauto module to have the taxonomy aliases generated dynamically. The problem is that the pattern apparently expects a fixed depth, while my taxonomy is not that stiff - some items have one, and some up to 3 branches underway. Can such a scenario be addressed by pathauto?
3 Answers
Well, I'm really surprised such important functionality hasn't been implemented in D7.
Here we go: too much talk, not so much work.
In short: currently there's no token for dynamic taxonomy depth like termpath
in D6.
-
I'm too fresh to Drupal to arbitrarily say it hasn't been implemented. What syntax have you used in termpath/D6? I would gladly give it a try. Commented Jun 21, 2011 at 21:33
-
-
OK, in catpath then - what expression did you have to handle variable depth paths? Let me try that in D7 Commented Jun 22, 2011 at 13:15
-
catpath
provides taxonomy tree so far. But there's no such an option in D7.– P4tientCommented Jun 22, 2011 at 14:01 -
I'm also quite miffed by this missing bit of critical functionality.
A workaround you could use for now is to use the token [node:field-section:url:relative] (replace "section" with the name of the taxonomy term that you've made a field on your node content type).
But then you must do a second step and that is to turn OFF the default handling of slashes in strings in the Pathauto > Settings tab. It is all the way at the bottom under "Punctuation". You must change the dropdown setting to "No action (do not replace)".
Although this should get you where you want, it is risky, as it now opens up the possibility of 404 errors if there is an unencoded slash in the title of a node or any other field that would find its way into your pretty URLs.
I'm also trying to get this quick and dirty module to work -- http://drupal.org/node/741914#comment-5025862 -- but thus far it is only outputting the deepest term in the URL and not the entire hierarchical chain. I'll keep you posted if I do get it to work.
-
I did get the "quick and dirty" module to work, after all. Commented Nov 15, 2011 at 17:48
Since this question was asked a lot of things changed and this is possible now so for anybody that stumbles upon this question the way to go is using the "join-path" token for the full url including the current term
[term:parents:join-path]/[term:name]
It will output all the parent's names no matter if you have 1,2 or ..x making the depth dynamic.