prepend existing path (for parent/child) without duplicates

scottrigby - May 10, 2008 - 14:35
Project:Node Hierarchy
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

greggles - May 13, 2008 - 08:44
Title:prepend existing path (for parent/child ?» prepend existing path (for parent/child) without duplicates
Project:Pathauto» Node Family
Version:5.x-2.1» 5.x-2.x-dev
Component:User interface» Code
Category:support request» bug report

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

fago - June 9, 2008 - 07:01
Status:active» won't fix

this token is not from nodefamily.

#3

scottrigby - June 9, 2008 - 16:35
Project:Node Family» Node Hierarchy
Version:5.x-2.x-dev» 5.x-1.x-dev

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:

  1. Should I update to 5.x-1.0 (or the more recent 5.x-1.x-dev)?
  2. If I update to one or the other, will I need to do anything special with the tables or just run update.php?
  3. And if I do, will it just fix the issue? If so, what tokens do you recommend I use for the issue above?

Thanks in advance!
:) Scott

#4

greggles - June 9, 2008 - 18:14
Status:won't fix» active

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

ronan - July 18, 2008 - 03:24
Status:active» fixed

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

Anonymous (not verified) - August 1, 2008 - 03:26
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.