University of Oregon

Duplicate Drupal dhtml-menu items to use again

I have some sub menus that I want to use as the dominant secondary nav when the user lands on the sub pages.

Now I’ve yet to be able to figure out how to reuse a menu in more that one place on the page. Maybe I need to do a more extensive module search but I set out to to attempt it with jQuery and would you believe it… It worked!

Drupal dhtml_menu accommodate non-javascript viewers

I wanted to find a solution for using dhtml menus while accommodating non-javascript viewers.
Turns out it was an easy fix.

The menu currently uses drupal’s: drupal_add_css to append the css document which collapses all the menu items by default. Since the menu module relies on jQuery, I changed the append method to use jQuery instead.
Here’s my suggested fix: (more…)

Conditional menu behavior in Drupal

I added some code to the page.tpl.php to change the behavior of the elearning page on ODT for logged in vs anonymous viewers.

    $(document).ready(function() {
uid) {?>
				$('.expanded').each( function(){Drupal.dhtmlMenu.toggleMenu($(this));}); //Close all
				Drupal.dhtmlMenu.toggleMenu($('#skillport-login')); //Open login button section

				$('.collapsed').each( function(){Drupal.dhtmlMenu.toggleMenu($(this));}); //Open all



dhtml-menu functionality w/o the menu module

So why would you want to take advantage of dhtml-menu functionality w/o using the built in Drupal menu module?
In this case we want to use the nested menus style for the content while employing consistent show-hide functionality. Here’s the catch: The content isn’t a list of links it’s paragraphs where each section heading collapses and expands the sub-content. (more…)