How to render nav hierarchy as multiple ULs

peterx14 - June 7, 2009 - 09:30

Hi all,

I am building a site that needs to present it's navigation hierarchy as a number of separate unordered lists. So, the top of the page features a horizontal nav bar with about 6 or 7 options. When the user clicks on one of the options, that takes them to a new page and that page also shows the other sibling pages on the hierarchy. Clicking on one these may do the same where the nav hierarchy is sufficiently deep!

Examples. I've been trying to find a site that does the same.... and here's one:
http://pubs.media.mit.edu/index2.jsp

The link above takes you to the "Research" page which shows the entire "Research" tier of the nav hierarchy.

This is pretty much identical to what I want to do except that my site needs to have up to 4 separate ULs.

Any guidance on this would be huge help! :D

Thanks,

Peter.

menu_tree() frenzy! :)

mverbaar - June 7, 2009 - 13:43

menu_tree() frenzy! :)

...

Jeff Burnz - June 8, 2009 - 00:20

Check out the Menu Block module, it will help you achieve exactly what you're describing.

Look at multiflex-3

nbz - June 8, 2009 - 04:11

That theme has the simplest implementation I could find and I borrowed it for the arthemia theme. I put the actual snippets of code on my blog:

In template.php:

<?php
function phptemplate_primary() {
 
$output = '<div id="primary-links-region">';
 
$output .= menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
 
$output .= '</div>';
  return
$output;
}
?>

in page.tpl.php, if you want to do that with the primary links, replace their code with:
<?php
if (isset($primary_links)) :
  print
phptemplate_primary($primary_links);
  endif;
?>

You will need to modify that a bit to get it to work for other menus too.

Thank you all absolutely

peterx14 - June 8, 2009 - 16:20

Thank you all absolutely loads for your replies!

I'm running with the Menu Block module... all seems good so far. :D

 
 

Drupal is a registered trademark of Dries Buytaert.