0
我想列出一個詞彙術語如下格式上市的Drupal taxanomy方面
<ul id="vid1">
<li>term1</li>
<li>term2
<ul>
<li>term2-child1</li>
<li>term2-child2</li>
</ul>
</li>
<li>term3
<ul>
<li>term3-child1</li>
<li>term3-child2</li>
</ul>
</li>
</ul>
我如何修改下面的代碼,以滿足我的要求
<?php
$vid = 1;
$terms = taxonomy_get_tree($vid);
print_r($terms);
echo "<ul>";
foreach ($terms as $term) {
$count = db_query("SELECT COUNT(nid) FROM {taxonomy_index} WHERE tid = :tid ", array(':tid' => $term->tid))->fetchField();
print "<li>".$term->name." (".$count.")</li>";
}
echo "</ul>";
?>
謝謝它的工作原理。我如何將它們鏈接到相應的條款? – troshan
,類似於