Closed (fixed)
Project:
Taxonomy Redirect
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Apr 2010 at 18:46 UTC
Updated:
1 Jun 2010 at 09:30 UTC
Hi,
How can I make Taxonomy Redirect work with this template.php snippet to create comma separated tags on my node page?
<?php
function phptemplate_preprocess_node(&$vars) {
// Taxonomy hook to show comma separated terms
if (module_exists('taxonomy')) {
$term_links = array();
foreach ($vars['node']->taxonomy as $term) {
$term_links[] = l($term->name, 'taxonomy/term/' . $term->tid,
array(
'attributes' => array(
'title' => $term->description
)));
}
$vars['node_terms'] = implode(', ', $term_links);
}
}
?>
Comments
Comment #1
danny_joris commentedOk, I fixed it. I changed the output into the output I normally use with the Taxonomy Redirect module...
Comment #2
agileware commentedThe original code snippet is not so good.
Taxonomy paths should not be hard coded like that.
If you use this it will work without you having to hard code your redirect.
So you won't have to update your theme every time you change the redirect.
Comment #3
agileware commented