1

我刚刚为节点创建启用了多个术语,我只想将这些多个术语显示为一个块中的树结构,我尝试使用以下代码

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

根据用户选择将相应地显示为树。

任何人请帮助,

4

1 回答 1

0

查看分类沿袭模块:

http://drupal.org/project/lineage

于 2011-04-12T19:30:12.490 回答