Token support should include full path like [termpath] token

SkidNCrashwell - June 25, 2009 - 16:14
Project:Primary Term
Version:6.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Issue tags:pathauto, tokens
Description

I think a new token should be added to include the full path for a term.

My nodes may have several taxonomy categories assigned to them but I would like the auto-generated URL alias to use the primary term's full path. e.g. I may have node ID 1 which is assigned to the following categories (taxonomy) -

dvd/action
dvd/fantasy
fantasy-films/dvd

I may want the dvd/fantasy to be the primary term and have the URL only to be mysite.com/dvd/fantasy/1 even if someone arrives to the node by clicking on a link within mysite.com/fantasy-films/dvd. Currently this is not possible because if I use the [primary-term] token for my url, the url alias would be generated as mysite.com/dvd. With pathauto I can use the [termpath] or [termpath-raw] token which separates the category and supercategories with '/' but when a node has multiple categories assigned to it, the [termpath] token will use the first (or lowest weight) category to generate the URL and in my example that would be dvd/action.

#1

ericduran - September 23, 2009 - 19:15
Status:active» needs review

Here's a patch for it.

I needed it for a project.

AttachmentSize
primary_term.patch 815 bytes

#2

tuffnatty - October 14, 2009 - 09:13
Status:needs review» reviewed & tested by the community

+1 for this patch

#3

johnskulski - November 5, 2009 - 22:08

works wonderfully

 
 

Drupal is a registered trademark of Dries Buytaert.