Build Drupal Taxonomy list into a Block

  • Create new block (Home › Administer › Site building › Blocks › Add block)
  • Put following code into "Block body", set $vid as mentioned in the comment
  • Set "input format" to "PHP code"

<?php $vid = 1; // Set the vid to the vocabulary id of the vocabulary you wish to list the terms from $items = array(); $terms = taxonomy_get_tree($vid); foreach ( $terms as $term ) { $count = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $term->tid)); $items[] = l($term->name, "taxonomy/term/$term->tid") . " ($count)"; } if ( count($items) ) { print theme('item_list', $items);} ?>

Thanks to source - Drupal forum
Related pages - might be useful,

Ubercart's stuff