option to include term name rather than term id

mikegoodwin - August 30, 2007 - 02:11
Project:Taxonomy Redirect
Version:5.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I would like to be able to redirect the links to a url including the term's name rather than its id. For example I would like to be able to redirect image vocabulary terms to "photos/tags/tag-name-1" or "photos/tags/tag-name-2", etc. Can this be easily implemented? Thanks.

#1

mikegoodwin - August 30, 2007 - 13:26

I figured it out...I just have to change the return statement slightly in the taxonomy_redirect_term_path() function.

#2

Prodigy - August 30, 2007 - 13:28

I think PathAuto would better compliment what you're trying to do.

#3

mikegoodwin - August 31, 2007 - 02:53

I agree, except that I want the url's like "photos/tags/tag-name-1" or "photos/tags/tag-name-2" to be directed to pages that have been created with views. When I tried to use pathauto, the urls would redirect to the standard taxonomy module pages that list node teasers...rather than to the pages that views created. So, I was trying to find another solution.

#4

arcX - October 22, 2007 - 13:09

I think that this would be good too. Like a drop down menu on the Admin page maybe.

Or, even just having a theme function, maybe like this, where we could overwrite the path:

theme_taxonomy_redirect_path($term) {
// Customised:
return ($path == NULL ? 'taxonomy/term' : $path) . "/" . strtolower($term->name);
}

#5

wrunt - November 19, 2007 - 07:31
Status:active» fixed

I've changed the path format to replace !tid and !name with the term id and name respectively. You can also override this behaviour by defining the function taxonomy_redirect_custom_term_path($term, $path). These changes will be in the 5.x-1.1 release.

#6

Anonymous - December 3, 2007 - 07:41
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.