0

There are lot of tutorials on Internet about how to display menu, but no one works for me. I have tried:

$menu_array = menu_navigation_links('menu_menu-login-menu');
print theme('links__menu_login_menu', array('links' => $menu_array));
print drupal_render(menu_tree_output(menu_tree_all_data('menu-login-menu')));

Both don't work.

My menu looks like this.

enter image description here

1
  • By Default all the menus are available as block under Blocks section. You can assign it in to required region. Are you trying to do something different?
    – Cool
    Commented Jun 15, 2016 at 8:57

1 Answer 1

2

Have you tried using the Menu Block module (D7)?

Disable the main menu in the theme settings and create one or multiple menu blocks with a lot of options for the menus. The module can render submenu items with the main navigation and/or in a separate menu-block. The Menu block module can render a custom menu as well.

You can also add an extra region to your theme that renders a menu-block-menu inside a nav-tag:

yourtheme.info file add:

regions[nav_custom] = Nav Custom

In page.tpl.php add:

<?php if ($page['nav_custom']): ?>
    <nav id="nav-custom" role="navigation" class="navigation">
      <?php print render($page['nav_custom']); ?>
    </nav> <!-- /.section, /#nav-custom -->
<?php endif; ?>
1
  • YES, thanks. I have already fixed this problem in the almost same way, you write here...
    – Q-bart
    Commented Jun 17, 2016 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.