简体   繁体   中英

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

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); 在此输入图像描述

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.

意见

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

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.

您应该使用Drupal 7中的“node - ###。tpl.php”。使用2个连字符而不是1或Drupal不会将您的文件读取为节点模板。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM