Shouldn't l() use whatever is set here?
nicknickoli - September 21, 2009 - 22:03
| Project: | Taxonomy Redirect |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi, I'm rewriting term links on my nodes to use a comma seperator. For some reason,
<?php
l($taxonomy->name, 'term/'.$taxonomy->tid);
?>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'], ', ');
#1
Sorry, the links I'd expect to get rewritten on pages are coded as
<?phpprint l($taxonomy->name, 'taxonomy/term/'.$taxonomy->tid);
?>
#2
There 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
print l($taxonomy->name, 'taxonomy/term/' . $taxonomy->tid);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:
print taxonomy_term_path($term);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.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.