0
votes

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.

2
I don't have any easy access right now...but can't this be accomplished using Views and pulling the proper taxonomy information?the_e
I am no sure. Maybe. I tried to accoplish this but without satysfiyng results. I was not able to set the views. I maybe found a solution using taxonomy_menu module and menu_block. We will seen. I'll keep you posted.Bery

2 Answers

1
votes

Hi all and thanks for your replies. I found a way how to accomplish this with modules.

 1. Enable Taxonomy menu module
 2. Enable menu block module
 3. Choose in the menu block created your taxonomy menu
 4. Check the "Make the starting level follow the active menu item." option and place the block in your content region :-)

It is maybe not that easy as write a few lines of PHP code but it is higly sufficient solution even for non-programmer and it can be also easily modified.

0
votes

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