Below code is how to render code in Drupal 7 template & block.
//Render the main menu In your template and block using below code
<?php
$main_menu_tree = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
print drupal_render($main_menu_tree);
?>
//Render user menu In your template and block using below code
<?php
$main_menu_tree1 = menu_tree(variable_get('menu_main_links_source', 'user-menu'));
print_r(drupal_render($main_menu_tree1));
?>
Thanks for following TOsTech
Like our Facebook page
https://goo.gl/2kaXBc
Subscribe us on YouTube and help us growing
https://goo.gl/BQuUy3
Follow on Instagram account
https://goo.gl/LVWUQ5
Also, Read And Follow our Blog
https://goo.gl/55WrBR
Follow on LinkedIn -
https://goo.gl/tXXfAy
Thank u and keep supporting👍
- TOsTech team
Stay Connected Stay Techy
TOsTech Team
No comments:
Post a Comment