All pastes #944303 Raw Edit

template taxonomy

public php v1 · immutable
·published 2008-03-16 00:19 UTC
rendered paste body
<?php// split out taxonomy terms by parentfunction bowwowtheme_liquid_print_terms($nid) {  $terms = taxonomy_node_get_terms($nid);  $links = array();  $processed = array();  if($terms){    foreach($terms as $term){      $parents = taxonomy_get_parents($term->tid);      foreach($parents as $parent){        if(!in_array($parent->tid, $processed)){          $links[] = l($parent->name, taxonomy_term_path($parent), array('rel' => 'tag', 'title' => strip_tags($parent->description)));          $processed[] = $parent->tid;        }      }    }    $output = theme('item_list', $links);    return $output;  }}?>