prepend existing path (for parent/child) without duplicates
| Project: | Node Hierarchy |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Hi,
This is different from the request in http://drupal.org/node/241495 I think.
i just want to place nodes of a certain type at a certain path, but have that path also respect the existing hierarchy (e.g., http://url.com/node-type/parent/child/grandchild etc).
Under Node Path Settings, I can use [fullhierarchypath] to respect the hierarchy – or – I can use [type-name] to use the node type. But I can't so something like [type-name]/[fullhierarchypath] or else the path repeats the type over and over for each level of parent-child relationship (like this: http://url.com/node-type/node-type/node-type/parent/child/grandchild). Not what I had in mind... I am trying to use the node-type just as a way to categorize the site into 'sections' so the url will help people know where they're at (along with corresponding breadcrumbs).
One way I found to get around this is to give those node-types a vocabulary containing the term I want to use, and make that optional (so i can select it for parents, but not for children) – then use [term-raw]/[fullhierarchypath] .... that way only one term shows if only the top-level parent has this taxonomy term selected.
This just seems like not the best workaround, and hoping there may be a better way to do it that I'm just not aware of yet?
Cheers!
Scott

#1
Yeah, this should be fixable.
There are several tokens which can get recursive like this - termpaths being another one, though i think that termpath actually works out OK for this, and bookpaths and menupaths - the trick is to calculate the parentage tree without looking at the alias of the parents.
But, this is up to the token provider and not to Pathauto - so I assigned this to the module I think is providing the token.
#2
this token is not from nodefamily.
#3
Greggles & Fago – I'm using Node Hierarchy for this functionality, so assuming I should assign the project to Node Hierarchy. Please correct me if I'm wrong
For the Node Hierarchy module, I've been using 5.x-1.x-dev for a while now... looks like the snapshot was from 2007-11-11.
I'd normally assume I should update... This may be a question for someone else, but:
Thanks in advance!
:) Scott
#4
Yes, that is the proper place. (@fago - sorry for assigning it to the wrong one).
@scottrigby - you should do an update on a test site to answer your questions in #3.
#5
Hi scottrigby,
Sorry it took so long to get back to you. The token you need is
fullhierarchytitlepath-raw. It does as greggles describes: it creates a hierarchy using the parent's title and not their alias.The pattern you should use is
[type-name]/[fullhierarchytitlepath-raw]
Thanks
Ronan
#6
Automatically closed -- issue fixed for two weeks with no activity.