Posted by Merlin on Wed Sep 13, 2006 7:05 pm.
I spent about an hour and improved my old DHTML menu thing to make it much easier to simply drop in. It also uses better HTML.
It's still not perfect; the javascript is kind of crappy, and it hardcodes an onClick.
Still, it's a start. Maybe one of you fine js folk would like to rewrite this, now that it's more of a dropin.
So here's what you do: Take whichever version you need (there's one here for HEAD and one for 4.7) untar it, and drop it in your theme directory.
In your template.php add this:
<?php
include_once 'dhtml_menus/template-menus.php';
?>| Attachment | Size |
|---|---|
| dhtml_menus_4.7.tar.gz | 1.91 KB |
| dhtml_menus_5.0.tar.gz | 1.89 KB |


You might be interested in
You might be interested in this version of drop down menus with pure CSS and no js - compatible with all CSS browsers (at least that's the claim). See http://www.grc.com/menu2/invitro.htm
Not keen on dropdowns
Eh. I'm not a big fan of menus that drop down when hovered over. I can see how to do that in CSS but I find such menus hard to use.
These DHTML menus open and close with clicks; when you open them they stay open until you close them, and they remember their state from page to page. That's a very important feature, IMO.
Where is the url to download ?
Sorry, but where is the url of the file ?
Oops!
Anonymous didn't have access to view the attachments. You should see them now. My bad.
parent pages?
Nice. I wish there was a way to access pages for parent items.
There is!
However, it's really obscure.
In the template-menus.php that you include, there's a function you can use to re-add parent items into the menu list if they have important content:
<?phpfunction _get_add_links() {
return array(
'admin' => "administration overview",
);
}
?>
In the 5.0 version, by default, I only include that top page cause in general it's the only one I care about. But I can see where there may well be others that matter. Simply add them to that list.
Hi I'm running Drupal 4.7
Hi
I'm running Drupal 4.7 and I've tryed to make this code working, but it wont't, I've put dhtml_menus folder into /themes/goofy_theme/ directory, I've pasted this: "include_once 'dhtml_menus/template-menus.php';" into goofy.theme (at the end of code) but there's no effect at all… Any suggestions?
Post new comment