Famille
$vocabulary = taxonomy_vocabulary_machine_name_load('mes_demandes_en_ligne');
$terms = array();
if ($vocabulary) {
$tree = taxonomy_get_tree($vocabulary->vid, 0, 1);
if (count($tree)) {
foreach ($tree as $item) {
$obj = taxonomy_term_load($item->tid);
if ($obj) {
$terms[] = $obj;
}
}
}
}
?>
-
foreach ($terms as $term) {
-
$term_link = field_get_items('taxonomy_term', $term, 'field_link_form');
$term_link = is_array($term_link) ? array_shift($term_link) : false;
$term_image = field_get_items('taxonomy_term', $term, 'field_icone_form');
$term_image = is_array($term_image) ? array_shift($term_image) : false;
$subterms = array();
$subtree = taxonomy_get_tree($vocabulary->vid, $term->tid, null);
if (count($subtree)) {
foreach ($subtree as $item) {
$obj = taxonomy_term_load($item->tid);
if ($obj) {
$subterms[] = $obj;
}
}
}
?>
}
?>