10. Configure menu.py
- A menu is included in the scaffolding of every Web2py application you create. It can be found in the models section of the admin tool.
- At the top section of the
menu.py
file is area where you can customize your app title, subtitle, and descriptive information. You can also configure your app to be logged in Google Analytics.
- In this area of
menu.py
you can setup menu links as well as hierarchical drop down menus.
- Line 27 elements
T('Manage Aliases')
is the menu title. The T()
function will allow for the translation of strings to different languages.URL('default', 'manage_aliases')
points to the controller default
and the function manage_aliases
- If you want submenus of
manage_aliases
you would place those inside of the [ ]
response.menu = [
(T('Manage Aliases'), False, URL('default', 'why-web2py'), [])
]
[ Previous ] [ Next ]