In order to clarify my previous post if you replace the line 83 in
layout.html with
<div class="nav-collapse">
and remove inline css style from line 76, the nav will collapse normally
also on desktop.
Said that, in order to generate dinamically a menu I would do in this way
(pseudo code to explain a conceptual idea):
def menu_builder():
menu = []
for each whq\calendar in query result:
submenu = []
for each function in whq\calendar controller:
submenu.append(('function_name', None, URL('controller',
'function')))
menu.append(('controller_name', None, '#', submenu))
return menu
So you could make
response.menu =menu_builder()
and use MENU helper as usually.
Il giorno giovedì 24 ottobre 2013 15:45:46 UTC+2, Annet ha scritto:
>
> Hi Paolo,
>
> Thanks for you reply. At the moment I am not using Web2py's menu helper.
> My menu's are retrieved from a database and I have been struggling
> to get them into the right structure:
>
> I have a table nav which contains all menu items and a table nodenav which
> combines nodes with navs, when I query the database for a menu
> it returns for example this:
>
> 9;"whq";"whoWeAre"
> 9;"whq";"whatWeDo"
> 9;"whq";"howWeWork"
> 9;"whq";"whereWeAre"
> 9;"calendar";"openingHours"
> 9;"calendar";"eventList"
> 9;"calendar";"timetable"
> 9;"calendar";"courseTable"
>
> Where 9 is the nodeID, whq and calendar are the controllers and whoWeAre
> etc are the functions, I haven't figured out
> yet how to get this in a menu with whq and calendar as menu item and the
> functions in drop downs. In that case I
> could make use of web2py's is_mobile feature.
>
> This may be the best option.
>
> Best,
>
> Annet
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.