문제

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.

도움이 되었습니까?

해결책

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;
?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top