Closed (works as designed)
Project:
Pathauto
Version:
7.x-1.0-rc2
Component:
Tokens
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2011 at 14:16 UTC
Updated:
21 Feb 2014 at 22:47 UTC
Jump to comment: Most recent
Comments
Comment #1
RumpledElf commentedTry the [node:field-yourtaxonomyfieldname:name-tree]
Works for me, mostly. But that's another issue.
Comment #2
cesareaugusto commentedHi giraffian! Thanks for your quick reply!
My taxonomy reference field name is field_citta. I tried this
[node:field_citta:name-tree]. But I got an error which says this is not a valid token.Where do you think I should issue this?
Comment #3
RumpledElf commentedThat only works for single-select taxonomies, if you've got it multiselect you can't do that.
I have a custom token on d7 to let you build a path from the *first* tree in a multiselect taxonomy so I didn't notice that particular problem until starting a new site ...
Comment #4
cesareaugusto commentedWould it be implementable? In case it will never be possible to have it multiselect in Drupal... how could I select just the last child term in the hierarchy?
Eg: if I got the hierarchical terms State>Region>City, how to render the URL: domain.tld/city/node_title
Comment #5
ANDiTKO commentedTry [node:taxonomy-
MyTaxonomyName]/[node:title]Replace the
MyTaxonomyNamewith your taxonomy name.Comment #6
nrdmagnus commentedFor Taxonomy term paths you can use the Imploded token, like explained ahead. But for Content paths you just don't have such an option! So the feature request would be: Imploded token for any Term reference field.
Trailed Taxonomy term paths:
Here to help.
Comment #7
whitingx commentedJust wanted to thank you for adding this detailed solution, step 2 (setting slash to do not replace) worked perfectly for me.
Comment #8
ParkerDMartin commentedIn greater detail, the node types that I am attempting to automatically alias have multiple term references from multiple taxonomies. I would like the option of selecting which taxonomy pathauto is utilizing. Is there any way to do this now?
In addition to this, could we also have the option to add [node:taxonomy-child] or something like it? I am frustrated that at the moment I can only select terms and vocabularies.
Comment #9
decibel.places commentedtried #1 but not a valid token
tried #6 but didn't change anything
Comment #10
duaelfr@cesareaugusto
You can achieve this by using Entity API and its submodule entity_token like this :
[node:field_citta:parents:join-path]/[node:field_citta:name]/[node:title]It will only work with the last dev version of pathauto
Comment #11
decibel.places commentedI solved it by creating a Computed Field and using that field as the path token containing the terms:
In my case it was even more complex because the Hierarchical Taxonomy Select fields were conditional on another vocabulary, so I had to get that controller vocab term tid then create a switch to load the term tids from the dependent vocabulary - I don't think #10 would work
Then I can simply insert the value of the computed field - with the "/" (make sure you are not replacing that punctuation character in your alias settings)
Comment #12
manuel garcia commentedThere's no need for pathauto to replicate this functionality.
With latest stable versions of both entity and pathauto, you can enable entity_token:
drush en entity_token -y, and then use the new tokens available for you, like[node:field-FIELDNAME:parents:join-path].Entity token module also provides a lot of other tokens, imho more than enough.
Comment #13
saratt commentedThe new token works great when the widget type is Select for the taxonomy select, but not when the type is hierarchical select. Is there anyway i can get the entire hierarchy(paret/child/grand-child/page-title) in the URL when using hierarchical select.
Thanks.
Comment #14
manuel garcia commented@st455 you may want to cross post in hierarchical select issue queue, it might be their problem perhaps.
Comment #15
zmove commentedSubscribing to this issue.
I'm not sure this issue would be related to modules that provides other taxonomy widgets.
The possibility to defined taxonmy in a hierarchical was is a core function. That's also a core function to be able to select multiple terms for one node. Hierarchical select, Taxonomy term tree widget and all module like that doesn't change this fact, they just change the way it's displayed.
So it's probably the job of pathauto, token and entity token to make possible to create hierarchical path based on hierarchical taxonomy (not the module, the fact to have parents and children terms).
Comment #16
velvetpixel commentedusing parents throws an error:
"The Pattern for all Basic page paths is using the following invalid tokens: [node:field_taxi:parents:join-path]."
field_taxi is my term reference machine name for basic page content type.
here is the full pattern I tried for the basic page path that trows the above error:
[node:field_taxi:parents:join-path]/[node:title]
This works:
[node:field_taxi]/[node:title]
But only provides the url path for the term the page is associated with and doesn't add the nested parent terms to the url :(
I have the following modules enabled:
Entity API 7.x-1.3
Entity tokens 7.x-1.3
Pathauto 7.x-1.2
Does this require the dev version of path auto to recognize that token syntax?