All pastes #944283 Raw Edit

template taxonomy

public text v1 · immutable
·published 2008-03-15 23:59 UTC
rendered paste body
// split out taxonomy terms by vocabulary
function bowwowtheme_liquid_print_terms($nid) {
     $vocabularies = taxonomy_get_vocabularies();
     $output = '<ul>';
     foreach($vocabularies as $vocabulary) {
       if ($vocabularies) {
         $terms = taxonomy_node_get_terms_by_vocabulary($nid, $vocabulary->vid);
         if ($terms) {
           $links = array();
           $output .= '<li>' . $vocabulary->name . ': ';
           foreach ($terms as $term) {
             $links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => strip_tags($term->description)));
           }
           $output .= implode(', ', $links);
           $output .= '</li>';
         }
       }
     }
     $output .= '</ul>';
     return $output;
}