我正在使用具有固定父级的菜单块,因此只有子级被渲染......但我想渲染父级链接。我能够得到父母的 $mlid,但这是我所能得到的。theme_menu_link 引发错误,因为 menu_link_load 返回一个带有 [title] [href] 之类的键的数组,而不是像 theme_menu_link 期望的 [#title] [#href]。有人可以告诉我如何呈现单个菜单链接的输出吗?谢谢!
function mytheme_preprocess_region(&$vars){
if($vars['region'] == "footer-top"){
foreach($vars['elements'] as $key => $item){
if(array_key_exists('#block', $item)){
$block_type = $item['#block']->module;
if($block_type == "menu_block"){
$plid = $item['#config']['parent_mlid'];
$parent_menu_link = menu_link_load($plid);
$parent = theme('menu_link', $parent_menu_link);
$output .= '<section>' ./* $parent .*/ $vars['elements'][$key]['#children'] . '</section>';
}
}
}
$vars['content'] = $output;
}
}