2011-04-07 120 views
1

我剛啓用的多個方面爲節點創建和我只是想顯示的多張條款 如方塊我嘗試用下面的代碼如何在Drupal中使用樹結構顯示節點術語?

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.'; 
} 
} 

sturctured一棵樹,但沒有運氣它只是顯示的所有方面,但我必須顯示如下

- parent term1 
    - sub term 1.1 
- parent term 2 
    - sub term 2.1 
     -- sub sub term 2.1.3 

基於用戶選擇將相應顯示爲一棵樹。

請人幫忙,

回答

相關問題