I'm just getting into using pathauto and I find it pretty powerful. I'm running into an issue that I don't understand though. I've created a hierarchical category set (plant classification) that applies only to one content type (plants) and is required. For every plant added, users should choose the most specific classification that is listed... For example: perrenial -- tomatoes -- red slicer tomatoes. I want these classifications to be automatically reproduced in the url of the nodes that are being created so I put "plant/[catpath]/[title]" in the node path settings for all "Plant" content types. When I do this I recieve the following error:
You are using the token [catpath] which is not valid within the scope of tokens where you are using it.
Why isn't this valid??
I appreciate your help on this! Andrew
Comments
Comment #1
gregglesIn that realm you need to use [termpath-raw].
Comment #2
strayhand commentedI'm trying to build things in a similar fashion, only [termpath-raw] isn't yielding the aliases that I'm expecting. Instead it's only reporting back the first or top term.
For example I have a content type called "Groups" with a vocabulary assigned to it called "Group." The vocabulary has nested terms as follows:
VOCABULARY:
Group
- Sojourner
-- 2009
PATHAUTO SETTINGS:
In my pathauto settings for "Group" content I have the following settings:
group/[termpath-raw]/[title-raw]
RESULTING ALIAS:
This is what I'm getting from pathauto:
group/sojourner/exploring-egypt-pharaohs-cleopatra
I should be getting...
group/sojourner/2009/exploring-egypt-pharaohs-cleopatra
Does this have something to do with how I've got my taxonomy setup? Does the multiple select throw this off? I was poking around in the code and I could be wrong but isn't the code for the "node" case only reporting back one term? How could it then be spitting out the term path with sub-terms separated by "/" I'm not by any means a PHP genius so please forgive me if I'm totally off here.
Thanks.
CODE: pathauto.module (line 99-114)
Comment #3
izallgood commentedI am seeing the same issue with the exception of that for some aliases work.
Example
VOCABULARY:
Games
- Expectant Couples
-- Adventures
PATHAUTO SETTINGS:
In my pathauto settings for "Group" content I have the following settings:
games/[termpath-raw]/[title-raw]
In some cases i get
games/expectant-couples/adventures/sasquatch-adventure
in other cases i get
games/expectant-couples/birds-nest
Both of which contain the taxonomy term adventures
Comment #4
strayhand commentedI think I figured out what I was doing wrong. It's not really a bug with the module so much as you have to setup things in a certain way. I had my taxonomy setup so that I could select multiple terms. So for example I was selecting both "Sojourner" and "2009".
What I needed to do was select only the child term, "2009". Now pathauto behaves the way that I intended for it to work and it inserts the full path of the term which includes both "Sojourner" (parent term) and "2009" (child term).
For anyone else trying to figure this out. I would point out that the [termpath-raw] token seems to grab the first term that comes across. SO, don't select multiple terms and everything will work out fine. I hope that helps.
Thanks.
Comment #5
izallgood commentedI think that I may be seeing a diffrent problem, being that sometimes i get the correct output and other times i don't.
Comment #6
ennobln commentedI have the same problem.
Using Terms with less than 6 letters they will not be shown in the path.
using:
destinations
- europe
-- germany
--- berlin
--- köln
getting this urls
destinations/europe/germany/berlin/[title-raw]
destinations/europe/germany/[title-raw]
using
--- koeln
instead of [köln] getting the same url
using
--- cologne
ist works well. So maybe it is questions of the lenght of the term?
Can somebody help?
Comment #7
dave reidThe original problem has a solution, so marking as fixed.