There are intermittent discussion about cascading menu from time to time.
http://groups.google.com/group/web2py/msg/9a04650f84649641
and recently:
http://groups.google.com/group/web2py/browse_frm/thread/cbe3556820e885bb
In this mail I attach a cascade menu draft. It is just a prototype far from being finished, because I am not good at css at all. I just try to define a kind of higher level syntax and make it work. The syntax features include:
* Each menu item can have a text label AND/OR an image icon.
* Submenus are appeared in a recursive way.
Volunteers are welcome to polish the work.
The only four major files I modified or introduced in this app are as below.
static/grcmenu.css # It actually comes from here (http://splike.com/projects/cssmenu.html)
models/menu.py # In final version, this would be adjusted into modules/menu.py
views/layout.html # Only one line genMenu(...) is inserted
controllers/default.py # The main sample
static/*.gif # Optional
Sincerely,
Iceberg, 2009-May-03, 18:00(PM), Sun
@Yarko:
Sorry that I don't quite get your point about the "onmouseover" and
the "The default behavior can be set in the css".
{{for _name,_active,_link in response.menu:}}
<li><a href="{{=_link}}" onmouseover="this.ccc=this.style.backgroundColor;this.style.backgroundColor='white';" onmouseout="this.style.backgroundColor=this.ccc;" {{if not _active:}}class="inactive"{{pass}}>{{=_name}}</a></li>
{{pass}}
It looks like you're not using that, so I was confused but it.
#rtnv {position: absolute; top: 6em; right: 0; width: 8em; margin: 0; padding: 0; font-family: Arial, sans-serif;}#rtnv > ul {width: 9em; margin-left: -1px; font-size: 85%;}#rtnv ul {border: 1px solid silver; border-width: 0 0 0 1px;}#rtnv ul li {border-width: 1px 0; border-color: white; padding: 0 0 0 5px; line-height: 1.25em;}#rtnv ul ul {border-width: 0 1px 1px 1px; border-color: gray silver gray gray;}#rtnv ul ul li {border-color: #FEFEFC;}
...focus on define a set of general menu
api in web2py, hopefully it would be stable enough, so that any latest
(and coolest) css menu solution can be adapted into web2py easily.