Show secondary menu on custom page in drupal 7

214 Views Asked by At

I have a custom page whose link is on secondary menu page.

Main Menu - Secondary Menu - - Custom page

When user go to custom page, secondary menu hides. Because of that to back to secondary menu page user needs to first click on Main menu and then secondary menu. I want to make Secondary menus visible on that custom page, so that user can directly click secondary menu.

How can I do that ??

3

There are 3 best solutions below

0
Daniela On

You can place a block with the secondary menu in your custom page only, using the block configuration: admin>structure>block, find your secondary menu, configure it (display it on every pages you want), and then, place it on specific theme region.

I hope I'll help you :)

0
AddWeb Solution Pvt Ltd On

Try to print into your custom page below code.

<?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Secondary menu'))); ?>

Thank You.

0
Harinder Maan On

$menuItems = menu_tree_page_data('menu-name'); foreach($menuItems as $key => $m) { //check current active menu if ($m['link']['in_active_trail'] && $menuItems [$key]['below']) { $menu = menu_tree_output($menuItems [$key]['below']); } } //print the menu print $menu;

You can use this to show your menu on custom pages, you also add the HTML tags to make menu layout according theme.