我已经用drupal 7创建了一个分层主菜单,看起来像这样:http://dl.dropbox.com/u/16019885/Unbenannt.PNG
现在,我试图通过以下php代码获取这个菜单在我的页面。tpl.php:
<?php print theme('links__system_main_menu', array(
'links' => $main_menu,
'attributes' => array(
'id' => 'menu'
)
)); ?>
我已经添加了这个函数到我的template。php http://drupal.org/node/855698#comment-4478948
但我得到的仍然是普通的菜单。
是这样的:http://pastebin.com/ApukJY0w
你需要设置父菜单项为"Show as expanded"
为此,在admin/structure/menu/manage/main-menu/list中编辑父菜单项并勾选"Show as expanded"