开发者

Dynamic Select in Drupal

开发者 https://www.devze.com 2022-12-15 19:31 出处:网络
In my way of learning drupal, I got stuck in this issue. I have Taxonomy v开发者_高级运维ocabularies that I set as tree with each node have different depth. Now, I need to display it in select box in

In my way of learning drupal, I got stuck in this issue. I have Taxonomy v开发者_高级运维ocabularies that I set as tree with each node have different depth. Now, I need to display it in select box in a way that only one select(the parent terms) at first. On change, it will fetch term's children and display another select box below it. This goes until the last term doesn't have any children.

How do I do that in drupal?


I'm not sure I understand the question, but I think Hierarchical Select could help if this is a question about the UI


not so clear question, may be using http://api.drupal.org/api/function/taxonomy_get_tree/6 will be helpful.

[edit]

You can use the depth parameter to make sure that you only have the top level items in your first select. Then you can (through an ajax callback) get sub items using the parent parameter.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号