In the last version of web2py you can pass A() helper instead of URL, so you can customize as you want. View the new welcome.
For example, this change menu if there log in: models/menu.py if is_user_logged_in(): response.menu += [ (T('My account'), False, A(T('My account'),_href='javascript: void(0);'), [ (T('Upload'), False, A(T('Upload'),_title=T("Upload your application"),_href=URL(request.application,'default','upload'))), (T('Profile'), False, URL(request.application,'default','user/profile')), (T('Logout'), False, URL(request.application,'default','user/logout')), ]) ] else: response.menu += [ (T('Login to upload'), False, URL(request.application,'default','user/login'), []) ] 2010/11/18 Joe J <joe.jasin...@gmail.com> > Hi all, I'm looking to customize the appearance if the menu on a per > controller basis. I found some code in the "old" book that seems to > do this. > However, when I try to run the below code, I get a "two many values to > unpack error". Does anyone know who I might go about doing this? > > Any help is much appreciated. > Thanks, > Joe > > In the controller, I have code as follows: > response.menu=[['civilized',True,URL('default','index')], > ['test',False,URL('default','index')]] > > > In my View, I'm coding the following: > {{if not response.menu:}} > <li><strong><a href="{{=URL('org','index')}}">Browse</a></ > strong></li> > <li><strong><a href=".....">Signup</a></strong></li> > {{else:}} > {{for _name,_active,_link in response.menu:}} > <li><strong><a href="{{=_link}}" class="{{='active' if > _active else 'inactive'}}">{{=_name}}</a></strong></li> > {{pass}} > {{pass}} > > > > > Traceback (most recent call last): > File "/Users/jjasinsk/Sites/web2py/web2py/gluon/restricted.py", line > 188, in restricted > exec ccode in environment > File "/Users/jjasinsk/Sites/web2py/web2py/applications/evesch/views/ > default/index.html", line 38, in <module> > ValueError: too many values to unpack > -- My blog: http://martin.tecnodoc.com.ar My portfolio *spanish*: http://www.tecnodoc.com.ar Checkout my last proyect instant-press: http://www.instant2press.com