Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 495
Nick Avatar asked Jan 20 '11 18:01

Nick


1 Answers

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"

like image 186
Muhammad Reda Avatar answered Oct 05 '22 23:10

Muhammad Reda