I really only need the mlid and title text for the first level below a certain menu item. Here\'s what I\'m doing at the moment. (It works, but I suspect there may be a more dru
I use this : Just add your path and eventualy the menu and it will give you the child.
function MY_MODULE_submenu_tree_all_data($path, $menu = 'main-menu', $curr_level = 0, $rebuilt_path='', $childtree = array()) {
$tree = menu_tree_all_data($menu);
$args = explode('/', $path);
$rebuilt_path = empty($rebuilt_path) ? $args[$curr_level] : $rebuilt_path . '/' . $args[$curr_level];
foreach ($tree as $branch) {
if ($branch['link']['link_path'] == $rebuilt_path) {
$childtree = $branch['below'];
if ($rebuilt_path != $path) {
$curr_level++;
MY_MODULE_submenu_tree_all_data($path, $menu, $curr_level, $rebuilt_path, $childtree);
}
}
}
$items = array();
foreach ($childtree as $child) {
$items[] = l($child['link']['title'], $child['link']['link_path']);
}
return theme('item_list', array('items' => $items, 'attributes' => array(), 'type' => 'ul'));
}