Created
December 29, 2010 16:30
-
-
Save domenicomonaco/758704 to your computer and use it in GitHub Desktop.
init committ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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: '); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment