/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function render_terms($node,$vocabid,$title=null,$divclass=null) { $terms = taxonomy_node_get_terms_by_vocabulary($node, $vocabid ); if ($terms) { $output = '<div class="field field-item'. ' '.$divclass .'"><div class="field-label-inline-first">' .$title .' </div> ' ; foreach ($terms as $term) { $term_links[] = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)))) ; } } $output .='</div>'; return ($output); }