[Zope] DHTML Popup menu bar built from content

J Cameron Cooper jccooper@jcameroncooper.com
Wed, 12 Mar 2003 12:17:43 -0600


>
>
>I have deeply tried to build a DHTML/Javascript menu bar based on the Zope
>content rather than having a fixed (hard coded in javascript) menu content.
>
I generally try to stay away from the monstrosity of DHTML, and the 
quirkiness of JavaScript.

But building popup or whatnot menus from CSS isn't very bad at all. The 
content generation is especially easy. You can very simply write a 
tree-walker in Zope to generate something like:

<div id="menubar">
 <div class="toplevel">Top Level A
   <span class="item">Content</span><span class="item">Content2</span>
 </div>
 <div class="toplevel">Top Level B
   <span class="item">Content</span><span class="item">Content2</span>
 </div>
</div>

(or if you really want to be clever, use unordered lists and anchor 
hrefs to look better in non-style browsers)

and style the id of 'menubar', and classes 'toplevel', 'item', and maybe 
'expandable item' to get a fully hierarchical popup menu system.

Take a look at http://devedge.netscape.com/ for an example of the 
latter. There are other CSS sites around that would love to show you how 
also.

        --jcc