Posted by Screenack on December 13, 2010 at 9:57pm
I believe I'm over-thinking this.
I wish to show a hierarchical or tree view of a vocabulary. it's a two-tiered taxonomy.
How would you do this?
TIA,
Kyle
I believe I'm over-thinking this.
I wish to show a hierarchical or tree view of a vocabulary. it's a two-tiered taxonomy.
How would you do this?
TIA,
Kyle
Comments
If I was doing this in a
If I was doing this in a custom module I'd do something like this, or maybe set tab depth via css based on the $term->depth. shrug
$items = array();$tree = taxonomy_get_tree($vocabulary->vid);
if ($tree && (count($tree) > 0)) {
$options = array();
foreach ($tree as $term) {
$items[$term->tid] = str_repeat('-', $term->depth) . $term->name;
}
}
print theme('item_list', $items);
Views does taxonomy term lists, I'm not sure how well it's display handles hierarchical terms.
taxonomy menu
Hi Kyle,
It sounds like you might be looking for something like taxonomy menu. When the terms are in a menu you can put them anywhere on the site you want using menu block.
Much thanks!
Thanks all! Taxonomy menu nails the problem. Since all it's really doing is rendering an unordered list, which is better, semantically, than what I was originally thinking and simple to roll out.
http://drupal.org/node/223675
http://drupal.org/node/223675
****Me and Drupal :)****
Clickbank IPN - Sell online or create a membership site with the largest affiliate network!
Review Critical - One of my sites