the gluon MENU() function does use the active flag. And my above code snippet works to highlight what link is active, but it feels a bit convoluted. So is there a better way? Maybe it would be good if the MENU() function automatically highlighted a link when the current location matched the URL passed.
On Sep 6, 9:43 am, mdipierro <[email protected]> wrote: > yes but I do not remember if the default layout would use this or not. > > On Sep 5, 6:18 pm, Richard <[email protected]> wrote: > > > How should the active flag be set? Currently I have: > > > response.menu = [ > > ['Home', request.controller == 'default', URL(request.application, > > 'default', 'index'), []], > > ... > > ] > > > The default examples always have 'False' for active. > > Richard > > > On Aug 14, 5:28 pm, mdipierro <[email protected]> wrote: > > > > Now (in trunk) if a meny item is selected is the has a class > > > web2py-menu-selected > > > > On Aug 13, 9:59 am, mdipierro <[email protected]> wrote: > > > > > I am putting this inMENUnow. > > > > > On Aug 13, 6:09 am, "Sebastian E. Ovide" <[email protected]> > > > > wrote: > > > > > > Hi Massimo, > > > > > > by "override layout.html " you mean to replace the "MENU" function > > > > > with a > > > > > "for" loop as it was before ? > > > > > > ie: > > > > > > {{if response.menu:}} > > > > > <div class="main"> > > > > > <ul> > > > > > {{for name,active,link in response.menu:}} > > > > > <li {{if active:}}id="nav-active"{{pass}}><a > > > > > href="{{=link}}">{{=name}}</a></li> > > > > > {{pass}} > > > > > </ul> > > > > > </div> > > > > > {{pass}} > > > > > > thanks > > > > > > On Thu, Aug 13, 2009 at 8:26 AM, mdipierro <[email protected]> > > > > > wrote: > > > > > > > I do not think this should be considered a web2py bug. You are > > > > > > supposed to override layout.html and assign a different css class > > > > > > when > > > > > > amenulink is active. I did not put it in layout.html andmenu.py to > > > > > > keep is leaner and easier to read. > > > > > > > On Aug 12, 9:25 pm, Richard <[email protected]> wrote: > > > > > > > Maybe add it to the issue tracker: > > > > > >http://code.google.com/p/web2py/issues/list > > > > > > > > On Aug 13, 11:57 am, ionel <[email protected]> wrote: > > > > > > > > > Massimo, > > > > > > > > > When will we have this feature added intomenuhelper? I really > > > > > > > > need > > > > > > > > this... > > > > > > > > > Thanks. > > > > > > > > > On Jun 17, 12:13 pm, mdipierro <[email protected]> wrote: > > > > > > > > > > Sorry, this needs to be added to themenuhelper. Not there yet > > > > > > > > > > Massimo > > > > > > > > > > On Jun 17, 10:29 am, blackthorne <[email protected]> > > > > > > > > > wrote: > > > > > > > > > > > since theMENU() helper has been added to web2py, I haven't > > > > > > > > > > make it > > > > > > to > > > > > > > > > > understand how does it indicate if the link is the current > > > > > > > > > > link > > > > > > which > > > > > > > > > > is supposed to do as described in the web2py slides. > > > > > > > > > > > I made something like: > > > > > > > > > > response.menu= [ > > > > > > > > > > [T('Intro'), > > > > > > > > > > request.function=='index',URL(r=request,f='index')], > > > > > > > > > > [T('Casas'), > > > > > > > > > > > > > > > > > > > > request.function=='houses',URL(r=request,f='houses')], > > > > > > > > > > [T('Local'), > > > > > > > > > > request.function=='place',URL(r=request,f='place')], > > > > > > > > > > [T('Mapa'), > > > > > > > > > > request.function=='map',URL(r=request,f='map')], > > > > > > > > > > [T('Tarifas'), > > > > > > > > > > > > > > > > > > > > request.function=='precos',URL(r=request,f='tarifas')]] > > > > > > > > > > > , all those functions, actually exist but when I access them > > > > > > nothing > > > > > > > > > > changes on the generated <li> and <a> items that I can use > > > > > > > > > > for CSS. > > > > > > > > > > I was expecting to see something like an ID or CLASS > > > > > > > > > > setting for > > > > > > the > > > > > > > > > > active link so that I could style it has I want but > > > > > > > > > > nothing. I just > > > > > > > > > > get: > > > > > > > > > > <ul class="web2py-menuweb2py-menu-horizontal"> > > > > > > > > > > <li><a href="/new/default/index">Intro</a></li> > > > > > > > > > > <li><a href="/new/default/houses">Casas</a></li> > > > > > > > > > > <li><a href="/new/default/place">Local</a></li> > > > > > > > > > > <li><a href="/new/default/map">Mapa</a></li> > > > > > > > > > > <li><a href="/new/default/tarifas">Tarifas</a></li> > > > > > > > > > > </ul> > > > > > > > > > > > Thank you, best regards > > > > > > -- > > > > > > Sebastian E. Ovide --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

