Syndicate

Syndicate content




Reply to comment

Posted by ninelouis
  • 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

Reply

  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.