1
我曾經有一個函數由Drupal的6加載來自特定詞彙的所有條款,以創建一個自定義菜單:打印方面7
function _taxonomy_top_links($vid = NULL) {
$terms = taxonomy_get_tree($vid);
$taxos = array();
foreach ($terms as $term) {
$taxos[] = array('title' => $term->name, 'taxonomy/term/' . $term->tid, 'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)));
}
return theme('links', $taxos, array('id' => 'menu-'. $vid, 'class' => 'menu clearfix'));
}
這不起作用在drupal 7,我猜想與新的領域api有關。你如何從一個特定的詞彙中獲取所有的詞彙以在頁面級預處理?
感謝您的任何幫助。
對不起回來遲了。我去taxonomy_menu,但我需要更多的靈活性,使其行爲像過濾器,並避免重建。這像一個魅力。謝謝。 – swan 2011-02-03 03:19:58