Prints a list of terms
- Posted By:realworks
- Category:Menus, Categories
- Type:PHP
- Views:600
Prints a basic list of all terms linking to a simple view of node associated with that term. Use with path auto for SEO urls.
parent term 1
child term 1
child term 2
child term 3
parent term 2
child term 4
child term 5
Paste into a block or where ever you want the list of terms to appear.
Snippet:
Login/Register to Comment this Snippet<?php
$vid = 1; /* <---- put correct vocabulary ID here */
$terms = taxonomy_get_tree($vid);
print "<ul>";
foreach ( $terms as $term ) {
print "<li>".
l($term->name,'taxonomy/term/'.$term->tid, array('title' => $term->name)).
"</li>";
} /* end foreach */
print "</ul>";
?>