Third or more custom menus in template theme.
Hello Everyone! Im trying to add another menu like primary-menu in page.tpl.php. I don't want use a blocks. Trying to use this to setup all in my theme |<?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')))); ?>| but the thing is that i don't know how to setup variables for this in template.php or just in page.tpl.php like |<?php $menu = menu_navigation_links('menu-your-custom-menu-name'); print theme('links__menu_your_custom_menu_name', array('links' => $menu)); ?>| Does it possible anyway? or only using block to put new menus in template ? Please help BR
Manually getting and inserting menus can be sort of a chore, and require a few obscure functions to fetch the menu array. Contrary to your wish, I do recommend simply using a block region to implement the menu for the sake of flexibility and ease. Let's hope this is easier in Drupal 8 :) Carl Wiedemann Website design & development consulting | c4rl.ws carl.wiedemann@gmail.com | skype: c4rlww On Mon, Mar 19, 2012 at 5:59 AM, Sargath <sargath@o2.pl> wrote:
Hello Everyone!
Im trying to add another menu like primary-menu in page.tpl.php. I don't want use a blocks. Trying to use this to setup all in my theme <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')))); ?>
but the thing is that i don't know how to setup variables for this in template.php or just in page.tpl.php like <?php $menu = menu_navigation_links('menu-your-custom-menu-name'); print theme('links__menu_your_custom_menu_name', array('links' => $menu)); ?>
Does it possible anyway? or only using block to put new menus in template ?
Please help BR
_______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
participants (2)
-
Carl Wiedemann -
Sargath