Closed (fixed)
Project:
Taxonomy Redirect
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2009 at 22:03 UTC
Updated:
28 Nov 2009 at 05:50 UTC
Hi, I'm rewriting term links on my nodes to use a comma seperator. For some reason, l($taxonomy->name, 'term/'.$taxonomy->tid); doesn't print links to the page taxonomy_rewrite has set. Some vocabularies go to our 'topic" view, some go to our "lens" view.
Thanks for any help on this!
function phptemplate_preprocess_node(&$variables)
{
// use commas instead of ordered list for terms
foreach($variables['node']->taxonomy as $tid => $taxonomy) {
$variables['taxonomy_links'] .= l($taxonomy->name, 'term/'.$taxonomy->name, array('title' => $taxonomy->name)) .', ';
}
$variables['taxonomy_links'] = rtrim($variables['taxonomy_links'], ', ');
Comments
Comment #1
nicknickoli commentedSorry, the links I'd expect to get rewritten on pages are coded as
Comment #2
agileware commentedThere is a note on the module page of this module that states that this module uses hook_term_path to rewrite term links.
This means that it is not actually a url redirect from taxonomy/term/tid to the new path, it is only a rewriting of the taxonomy links on the node pages.
If you output
Then you will get exactly what you asked for, which will be taxonomy/term/tid
If you want to print the taxonomy term path for a term using taxonomy_redirect do this:
That way taxonomy_redirect will be able to alter your link.
You pass into that function the term object that you want the link for.