views:

13

answers:

2

Hi there,

I would like to ask some Drupaler for help. Is it possible to show the subcategories of a taxonomy term on a node page? Let's say that a have taxonomy like this:

category 1
       subcategory 1
       subcategory 2
       ...

And I want for Ubercart product to show on a node page that an item from category 1 has following subcategories (e.g. products) subcat. 1. and to list a link to the taxonomy subcategory ther.

Heading
some text...
List of subcats...
footer.

It doesn't have to be in this order.. It just ilustrates the idea. Is this possible? Thanks in advance for help.

A: 

1 - in your node.tpl.php put some condition to check is it that page on which you want to load subcategory
2 - take the taxonomy term name or termid that you will get from the $node variable
3 - call this function and pass proper argument taxonomy_get_children($tid, $vid = 0, $key = 'tid')

I hope it will work

Jayjitraj

related questions