1
votes

In Drupal I have the page content type. I have created a vocublary and the terms in it make a heirachy as below:

  • Bird
  • Mammal
    • Dog
      • Poodle
      • bulldog
    • Cat
      • Tiger
    • Rabbit
  • Reptile
    • Lizard

I select the term when I create a content type. I wish to display all the pages that have have this conent type in a menu (unordered list) maintating the heirachy above. Is this possible? Which modules would you use to do this?

2

2 Answers

1
votes

You could use the taxonomy_menu module.

The module page: http://drupal.org/project/taxonomy_menu

This module renders a vocabulary into a menu. If this is not what you need (e.g. if you want to display ths vocabulary in a node content), I think you have to write a simple module for it that gets triggered in hook_nodeapi().

1
votes

With the views you would be able to get very far in this matter, but I'm not sure if it is worth it in this case. The thing with views, is that it can be a bit tricky to generate the markup you want. With views it's possible to create any kind of markup you want, and make it display whatever you want. However, sometimes the work required to get there is not worth it vs just making your own module to do it.

You should try to look into views first and see if you can get what you want.

If you're not able to get what you want, I think creating your own custom module is the way to go. I don't know if there is an api function to get the nodes, but it should pretty simple query required to get them. Then you have the power you create the markup exactly how you want. You could just create a theme function to do all this that you can call in your theme.