Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add this into your Template.php drupal theme
- function getTerm($vid, $link, $node, $tagsymbol, $labelname) {
- foreach((array)$node->taxonomy as $term){
- if ($term->vid == $vid){
- if ($link){
- $link_set[] = l((($tagsymbol)?$tagsymbol:'') . $term->name, taxonomy_term_path($term));
- } else {
- $link_set[] = (($tagsymbol)?$tagsymbol:'') . $term->name;
- }
- }
- }
- if (!empty($link_set)){
- $link_set = (($labelname!=false)?$labelname:'') . implode('', $link_set);
- }
- return $link_set;
- }
- //Add this into your node.tpl.php or node-NODETYPE.tpl.php each time for your vocabulary's terms
- print getTerm(1, true, $node, '#', 'Tags: ');
- // In example
- print getTerm(2, FALSE, $node, '', 'Topics: ');
Add Comment
Please, Sign In to add comment