Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: Danny_Joris commentedOk, I fixed it. I changed the output into the output I normally use with the Taxonomy Redirect module...
Comment #2
Agileware CreditAttribution: 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 CreditAttribution: Agileware commented