Here is my suggestion:
submenu1=[
['item1',False,URL(r=request,f='item1')],
['item2',False,URL(r=request,f='item2')],
]
submenu2=[
['item3',False,URL(r=request,f='item3')],
['item4',False,URL(r=request,f='item4')],
]
response.menu=[
['header1',false,'#',submeny1],
['header2',false,'#',submeny2],
]
and in view you can do something like this
{{for head in response.menu:}}
<b>{{=A(head[0],_href=head[2])}}</b><ul>
{{for item in head[4]:}}<li>{{=A(item[0],_href=item[2])}}</
li>{{pass}}
</ul>
{{pass}}
You can have another menu by using
response.my_other_menu and in view
{{for head in response.my_other_menu:}}
<b>{{=A(head[0],_href=head[2])}}</b><ul>
{{for item in head[4]:}}<li>{{=A(item[0],_href=item[2])}}</
li>{{pass}}
</ul>
{{pass}}
You can then give classes to the h2, ul, li tags to customize using
css.
T2 defines: T2.menu(response.menu) which generates a menu compatible
with
http://users.tpg.com.au/j_birch/plugins/superfish/
Massimo
On Oct 7, 10:35 pm, Snoboardfreak <[EMAIL PROTECTED]> wrote:
> politics? hehe freaky!
> (go O!)
>
> hmm...i try to explain better.
>
> i have 2 problems with making menus in web2py
> i can use css and js files to make nice menu
> but i need generated menus that use css
> i followed link in first post and made a cool vertical menu generated
> from controller.
> but it has no headers between links so looks messy.
>
> my first problem
> i have no idea how to code headers into generated menu using python.
> tried and tried but failed last couple of nights.
> or should i be trying to make menu from controller without
> response.menu?
> i dont need any fancy effex just need a menu like i get with
> response.menu in controller but with headers between links.
>
> my other problem
> other problem is including 2 menus a horiztonal and vertical in same
> view with each generated from different controllers
> -horozontal comes from default.py
> -vertical comes from myview.py
> -both menus should be in myview.html.
> -myview.html extends mylayout.html which also includes horiztonal menu
> from default.py
>
> when i try to generate 2 menus a vertical and horozintal on same page
> i get same links in both.
>
> sorry for stupid questions massimo
> hoping web2py makes generating menus easy
>
> who 'won' debate?
>
> snoboardfreak
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---