All pastes #947062 Raw Edit

Mine

public php v1 · immutable
·published 2008-03-18 03:49 UTC
rendered paste body
// split out taxonomy terms by vocabulary on each node.function my_theme_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;}//This is the address of my site with the above code. http://bowwowimport.com/products/rear-wheel-cylinder-brazilian//what I want to use as part of this code but I need to have the $vocabularies = taxonomy_get_vocabularies();// and show all the parents under Car Manufacturer formatted like the above code doesfunction my_theme_print_terms($nid) {  $terms = taxonomy_node_get_terms($nid);  $links = array();  $processed = array();  if($terms){    foreach($terms as $term){      $parents = taxonomy_get_parents_all($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;  }}// Thanks Eric (bowwowadmin)