Why is the drupal 7 submenu not displayed?

I can't seem to show my submenus.

I went to: Home "Administration" Structure "Menu

Then I edited the parent menu and checked the "Show as advanced" checkbox, but still nothing.

The code on my page.tpl.php page for navigation, which I mean, looks like this:

<?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.

+7
source share
3 answers

Make sure the parent menu of the "Show as advanced" attribute is set.

Go to admin/structure/menu/item/MENU_ITEM_ID/edit and check the box admin/structure/menu/item/MENU_ITEM_ID/edit "Show as advanced"

+15
source

Instead of using the $ main_menu variable, you can use the main menu block , which is created using the menu.

If you place the Main Menu block in the Navigation area in the admin / structure / block area, printing rendering ($ page ['navigation']) in page.tpl.php will print the full menu, including its submenu (children).

Just make sure you check the "Show as advanced" option in the parent menu link.

Finally, delete the material "print theme", otherwise you will get a double menu.

page.tpl.php will look something like this:

 <?php if ($page['navigation']): ?> <div id="navigation"><div class="section clearfix"> <?php print render($page['navigation']); ?> </div></div><!-- /.section, /#navigation --> <?php endif; ?> 
+6
source

An exclusive topic outside the box does not show a submenu in the main menu (2011/04).

If, however, you go to the administrator / structure / blocks and drag the menu block to the header area in a harsh topic, it has a submenu.

You will also have two menus, the original one without a submenu, and the new one with a submenu. You can disable the original in admin / appearance / stark / settings.

$ 2s, * -pike

+2
source

All Articles