On Wednesday, January 26, 2011 3:59:01 PM UTC-5, [email protected] wrote:
>
> Thank you both for your replies.
No problem. We're glad to have you here.
> One more quick question......
> The scaffolding app has a nice menu bar below the logo. Showing 3
> menus. 2 of which 'drop down'. How do I edit these lists? I have
> managed to edit the rest of th page using the html, css, static files
> and the controller. It looks like it has something to do with
> superfish java but beyond that im stumped.
>
If you look in the /models folder, in addition to db.py, you'll see menu.py
-- that includes all the content for the menu (i.e., labels and URLs) in the
form of a nested list of lists assigned to response.menu. Just make changes
to menu.py, and you'll get a new menu. You may not think of the menu as part
of your "models", but it's in the /models folder because all the model files
are executed on every request, so that's a convenient place to define the
menu since it tends to be needed across multiple controllers and actions.
If you look in layout.html, you'll see the menu inserted via:
{{=MENU(response.menu,_class='sf-menu')}}
The MENU helper takes the response.menu list of lists defined in menu.py and
generates the HTML for the menu. _class='sf-menu' tells it to set the class
of all the <ul> tags in the menu to 'sf-menu'. The jQuery code in the next
few lines then applies the Superfish menu to the 'sf-menu' lists.
- The MENU helper is documented here:
http://web2py.com/book/default/chapter/05#Custom-Helpers
- menu.py is mentioned here:
http://web2py.com/book/default/chapter/03?search=menu.py
- response.menu is also briefly mentioned here:
http://web2py.com/book/default/chapter/04#response
Enjoy.
Anthony