how to use views to display taxonomy vocabulary list in 2 level on Drupal 7

3.4k views Asked by At

I'm working on my first Drupal 7 project. I'm having a problem about vocabulary term listing :/ I hope you can advise...

I created Vocabulary named Services, and terms are 2 level as below (there will be many more); enter image description here

and I have a Services page to list all these services as in-2-level look. exactly how it looks above.

I googled and found some PHP codes to display all terms http://drupal.org/node/623644

But I need to make it with VIEWS MODULE (DRUPAL 7), I tired the VIEW below, and it only list the some of level 1 terms.

views

Any idea how to make this with Views Module? Appreciate helps!!! Thanks a lot!

2

There are 2 answers

1
soju On BEST ANSWER

I don't think it is possible with views without writing code.

You can create a view with a 'services' filter to display corresponding nodes, for this filter check Dropdown and Show hierarchy in dropdown. But it will not display terms like you want.

Otherwise, you can create an empty page (or use an existing page), create a corresponding template (node-###.tpl.php), and in this template you will use the code you found earlier to display terms like you want.

Or you can use taxonomy menu module, but it will not display in a block.

0
Ben Rogmans On

You should use "node--###.tpl.php" from Drupal 7. Use 2 hyphens instead of 1 or Drupal won't read your file as a node template.