Hi there!

I've been looking around for a while, and can't find a dummy-level explanation on how to do this. Something very similar was mentioned briefly here: http://drupal.org/node/127639

basically I've added a new menu to drupal called "new links". I've added the following to my page.tpl.php:

<?php if (isset($new_links)) : ?>
   <?php print theme('links', $new_links, array('class' => 'links new-links')) ?>
<?php endif; ?>

What code do I need to add to template.php to allow page.tpl.php to recognize this new variable?

I found an article talking a little about this subject, but it was for D5. Any help would be greatly appreciated!

Sean

Comments

matt blaine’s picture

You have to retrieve the menu to do it in this way

$new_links = menu_navigation_links('new_links');

print theme('links', $new_links, array('class' => 'links new-links')) 
sean porter’s picture

Thank you Matt, this worked, with a little finessing.

And for anyone else out there interested in doing this, when filling in the menu_navigation_links('your-new-menu') andarray('class' => 'links your-new-menu') pay attention to the menu name that Drupal gives your new menu, 'cause its not the same as the one you gave it, not even the machine-readable version. For instance if you make a new menu and give it the machine-readable name "new-menu" and title it "New Menu", Drupal names it "menu-new-menu." this is the name you'll have to put into the menu_navigation_links().