his documentation is a bit thin. he says to put this in the page.tpl:

theme_dropdown_menu($pid, $attributes = array())

but not *where*, and when i put it where it seems to make sense (the primary links div), well... nothing happens.

anyone using this successfully?

Comments

malc_b’s picture

I ended up with it a lot different. As it works I'm leaving it as is. If I'm reading my comments right I went back to suckerfish.js as I seem to remember the jquery version just didn't work. So in the module I have:

function dropdown_menu_init() {
	drupal_add_js(drupal_get_path('module', 'dropdown_menu').'/suckerfish.js');
}

With the original commented out. My suckerfish.js looks like:

sfHover = function() {
	try {
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
  	for (var i=0; i<sfEls.length; i++) {
  		sfEls[i].onmouseover=function() {
  			this.className+=" sfhover";
  		}
  		sfEls[i].onmouseout=function() {
  			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
  		}
  	}
  }
  catch(e) {
    return false;
  }
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

The try/catch is a recent addition to remove errors on no menu (admin theme). This is a separate file rather than inline but either would work I guess. Trade off between more each web page to more files at start.

In my page.tpl.php I have

      <?php print theme_dropdown_menu(2, $attributes = array('id'=>'nav')); ?>

2 is my primary links menu and I have secondary links combined with primary AFAIR. The web site is www.saharasisters.org.uk

datawench’s picture

for the record, my first mistake was in not realizing that the function call had to be echoed, not simply invoked:

<?=theme_dropdown_menu('2', $attributes = array('id'=>'nav'))?>

(as indicated in the prior comment)

i wound up inserting it in the "primary" div, and including the sfhover function listed above, in the header.

it's important to pay attention to the default css that comes with the module, since that's your layout baseline.

malc_b’s picture

BTW I think PHP5 is more particular in that it has to start <?php and not <?. When I was looking at Joomla (can I say that here :-)) a lot of modules gave me problem that I fixed by change the <? to <?php. So save yourself future problems by always using <?php.