Return to Snippet

Revision: 22794
at January 22, 2010 11:34 by daipratt


Initial Code
<h4>Tags</h4>
<ul>
	<?php
	$vid = 1;
	$vocab = taxonomy_get_tree($vid);

	$terms = array();
	foreach ($vocab as $key=>$value) {
		$count = db_result(db_query("SELECT COUNT(nid) as count FROM {term_node} WHERE tid = %d", $vocab[$key]->tid));
		print '<li><a href="/'.drupal_get_path_alias('taxonomy/term/'.$vocab[$key]->tid).'">'.$vocab[$key]->name.'</a> ('.$count.')</li>';
	}
	?>
</ul>

Initial URL

                                

Initial Description

                                

Initial Title
Drupal - Show the taxonomy in the format - "term(node count)" - for a given vocabulary

Initial Tags
drupal

Initial Language
Other