【问题标题】:how to display Node Terms in block with tree structure in Drupal?如何在 Drupal 中以树状结构显示节点术语?
【发布时间】: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


    【解决方案1】:

    查看分类沿袭模块:

    http://drupal.org/project/lineage

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-10
      相关资源
      最近更新 更多