Why aren't my drupal 7 submenu's showing?

Nick picture Nick · Jan 20, 2011 · Viewed 22.2k times · Source

I can't seem to get my sub-menus to display.

I've gone to: Home » Administration » Structure » Menus

Then, I've edited the parent menu and checked the tickbox that says "Show as expanded" - but still nothing.

The code on my page.tpl.php page for the navigation I'm referring to, is as follows:

<?php
if ($page['navigation'] || $main_menu): 
?>

<?php
 print theme('links__system_main_menu', array(
          'links' => $main_menu,
          'attributes' => array(
            'id' => 'nav',
            'class' => array('links', 'clearfix'),
          ),
          'heading' => array(
            'text' => t('Main menu'),
            'level' => 'h2',
            'class' => array('element-invisible'),
          ),
        )); 
?>

<?php
 print render($page['navigation']); 
?>
<?php
 endif; 
?>

What am I doing wrong?

Any help would be GREATLY appreciated.

Answer

Muhammad Reda picture Muhammad Reda · Apr 10, 2012

Make sure that the parent menu "Show as expanded" attribute is checked.

Go to admin/structure/menu/item/MENU_ITEM_ID/edit, and check "Show as expanded"