I just tried something like this: if request.function != 'wiki': response.menu += Wiki(auth).menu(controller="default", function="wiki")
On Wednesday, January 16, 2013 10:07:06 PM UTC+13, Paolo valleri wrote: > > Hi Alan, thank for the tip :-), it seems to work correctly. > The only issue is that when I call the function 'wiki' I get two menu, one > from the ad-hoc import, the other one from the common wiki. > What shoud be nice is to explicitly tell auth.wiki when it has to populate > the response.menu and when not. > Paolo > > > 2013/1/15 Alan Etkin <spam...@gmail.com <javascript:>> > >> > Now I want to have response.menu populated with the wiki pages too in >> every page I have, is there a way to populate it calling >> > somehow auth.wiki or I have to do that by hand, updating each time >> menu.py? >> >> If you put this on top of the controller (or model), you get the wiki menu >> >> from gluon.tools import Wiki >> response.menu += Wiki(auth).menu(controller="default", function="wiki") >> >> The controller and / or function is required since otherwise, the wiki >> object cannot resolve redirection to edit/search/etc., and that address >> should be an action that calls auth.wiki(). And also you must check the >> action name to avoid duplicating the sub-menu >> >> What about an extra set of keyword arguments to activate the menu?: >> >> auth.wiki(resolve=False, menu=True, controller=..., function=....) >> >> >> -- >> >> >> >> > > > > -- > Paolo > --