/ Published in: PHP
This is a simple little block that displays a list of terms in a vocabulary as a list of links to /taxonomy/term/tid pages. Items are listed in the order set for the vocabulary. You could probably use the php sort() function to change that if desired.
Be sure to change the $vid to reflect the vocabulary id of the vocabulary you wish to list. Also, you can change the "taxonomy/term/$term->tid" to any path you wish.
Be sure to change the $vid to reflect the vocabulary id of the vocabulary you wish to list. Also, you can change the "taxonomy/term/$term->tid" to any path you wish.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php /** * Lists terms for a specific vocabulary without descriptions. * Each term links to the corresponding /taxonomy/term/tid listing page. */ $vid = 1; $terms = taxonomy_get_tree($vid, 0, -1, 1); foreach($terms as $term){ $items[]= l($term->name, "taxonomy/term/$term->tid"); } return theme('item_list',$items); } ?>
URL: http://drupal.org/node/247472