Thanks, I was hoping this kind of thing would work, but I'm still doing something wrong.
In models, I added menu2.py which contains a custom menu but is set up just like the default menu in layout.html, and in the layout.other.html I added {{=MENU(menu2)}} but when I run the view, I am getting a response.write error type 'exceptions.NameError'>(name 'menu2' is not defined) I tried adding it to the index.html and get the same error. What am I doing wrong? thanks Anthony On Monday, April 29, 2013 5:31:48 PM UTC-5, Anthony wrote: > > There's nothing special about response.menu -- it's just a list of tuples. > You can just as easily store the menu in any variable, so you can create as > many menus as you want and then convert them to HTML in the view via the > MENU() helper: > > In menu.py, or separately in menu1.py and menu2.py, or wherever: > menu1 = [...] > menu2 = [...] > > In the layout: > {{=MENU(menu1)}} > ... > {{=MENU(menu2)}} > > Anthony > > On Monday, April 29, 2013 6:19:12 PM UTC-4, greaneym wrote: >> >> Is it possible to have two menu.py files in models that associate with >> response.menu? >> I wanted to have an index file that has something like this, >> >> {{extend 'layout.html}} >> {{include layout.other.html}} >> {{include dashboard.html}} >> >> where layout.other.html has the menu2 for the dashboard. Is it possible >> to associate >> a second file, menu2.py with response.render and layout.other.html and >> how would one >> set this up? I've tried tinkering but get errors with response.write. >> Maybe it goes against the web2py structure and another setup should be >> used? I wanted >> both menus available on whatever page is loaded. >> >> thanks, >> >> Margaret >> >> -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.