Displaying taxonomy terms differently according to their vocabulary
Key words and phrases
treating taxonomy terms differently according to their vocabularies theming Drupal terms by vocabTags
Description
This is how one would embed it in a node.tpl.php, but this should all be done in a pre-process function instead.
<?php
// here it is all together, expect normal typos:
$normal_terms = '<div class="normal-terms">';
$special_terms = '<div class="special-terms">';
foreach ($taxonomy as $tid => $term_object) {
$term_name = $term_object->name;
if ($term_object->vid == 3) {
$special_terms .= '<span>' . $term_name . '</span>';
}
else {
$normal_terms .= ' ' . $term_name;
}
$normal_terms .= '</div>';
$special_terms .= '</div>';
?>
Post new comment
