【发布时间】:2011-04-07 13:43:13
【问题描述】:
我刚刚为节点创建启用了多个术语,我只想显示这些多个术语 作为一个块中结构的树,我尝试使用以下代码
if ( arg(0) == 'node' && is_numeric(arg(1)) ) {
$node = node_load(arg(1));
if (module_exists('taxonomy')) {
$terms = taxonomy_link('taxonomy terms', $node);
print theme('links', $terms, array('class' => 'node-terms'));
} else {
print 'No associated categories.';
}
}
但运气不好,它只是显示所有术语,但我必须像下面这样显示
- parent term1
- sub term 1.1
- parent term 2
- sub term 2.1
-- sub sub term 2.1.3
根据用户选择将相应地显示为树。
请大家帮忙
【问题讨论】:
标签: drupal drupal-6 drupal-views drupal-taxonomy