ノード作成で複数の用語を有効にしたところ、次のコードで試したブロックに構造化されたツリーとして、それらの複数の用語を表示したいだけです。
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
選択したユーザーに基づいて、それに応じてツリーとして表示されます。
誰でも助けてください、