I need to display Taxonomy terms of one of my Vocabularies.

I need a simple Unordered list.

Thanks

Comments

serkan.arikusu’s picture

pushkarpathak’s picture

/**
 * Prints an unordered list of the all the terms in a vocabulary

 */
    $vid = 2;
    $terms = taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL);
    if ($terms) {
print '<ul>';
                foreach ($terms as $term) {
                print '<li>'.l($term->name, 'taxonomy/term/'.$term->tid).'</li>';

          }
print '</ul>';
    }