$vid is the vocabulary. In my case its value is 2.
<?php
/**
* Prints an unordered list of the terms (as links) that are
* associated to the currently displayed node.
*/
if ( arg(0) == 'node' && is_numeric(arg(1)) ) {
$node = node_load(arg(1));
$vid = 2;
$terms = taxonomy_node_get_terms_by_vocabulary($node, $vid);
if ($terms) {
print '<ul>';
foreach ($terms as $term) {
print '<li>'.l($term->name, 'taxonomy/term/'.$term->tid).'</li>';
}
print '</ul>';
}
}
?>
No comments:
Post a Comment