Question

Sir, I have a main menu rendered in page.tpl.php

<div class="menu_wrapper">
  <nav id="main-menu"  role="navigation">
    <a class="nav-toggle" href="#">Navigation</a>
    <div class="menu-navigation-container">
      <?php print drupal_render($main_menu_tree); ?>
    <div class="clear"></div>
  </nav>

In which here rendered main_menu_tree, i want to replace this page with my superfish menu.

Was it helpful?

Solution

Use block_load as follows, replace

<?php print drupal_render($main_menu_tree); ?>

with

<?php 
$block = block_load('superfish', 1);
$output = render(_block_get_renderable_array(_block_render_blocks(array($block))));
print $output;
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top