ok now I've managed to program my main menu to display horizontally and as a dropdown list. However I'm facing another issue here.
This is the code I in my template.php. Originally I got from this website http://stackoverflow.com/questions/2716787/how-to-get-all-the-menu-items.... It works fine. It gets exactly the number of child menu items.
function mca_get_menu_item_childrens($path)
{
$parent = menu_link_get_preferred($path);
$parameters = array(
'active_trail' => array($parent['plid']),
'only_active_trail' => FALSE,
'min_depth' => $parent['depth']+1,
'max_depth' => $parent['depth']+1,
'conditions' => array('plid' => $parent['mlid']),
);
//echo $parent['href']."\t";
$children = menu_build_tree($parent['menu_name'], $parameters);
return $children;
}
However, there is a problem. I can't get the 'href' and 'title' attributes of each child menu as I expect. Should I make any change in the code? If so, how? If not, then how can I get the 'href' and 'title' attributes of each child menu? This is how I call this mca_get_menu_item_childrens function from another function mca_links__system_main_menu of the same file.
<?php
......
$children = mca_get_menu_item_childrens($link['href']);
if(count($children) >= 1)
{