On Sun, May 24, 2009 at 12:45 AM, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote: > On Sat, May 23, 2009 at 5:54 PM, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote: >> On Sat, May 23, 2009 at 4:52 PM, David Pollak >> <feeder.of.the.be...@gmail.com> wrote: >>>> >>>> > Getting the secondary menu items: >>>> > def secondaryMenuItems: Seq[MenuItem] = >>>> > for { >>>> > req <- S.request.toList >>>> > line <- req.buildMenu.lines >>>> > kid <- line.kids >>>> > } yield kid >>>> >>>> While this does get all the current secondary menu items, I need all >>>> the current secondary menu items as well as their children (and their >>>> children) since I'll be handling the structure client side. I tried >>>> various combinations and hacking of the Menu snippet but can't seem to >>>> render all the children. Part of the problem is probably that I don't >>>> really know the Menu/MenuItem/Loc structure very well and the >>>> Scaladocs are.....somewhat lacking :-) >>>> >>>> I'll keep trying to decipher the source to come up with something, but >>>> any further insights will be appreciated >>> >>> Each MenuItem has a kids property which is the submenus. You can recurse >>> into the kids on display. The net.liftweb.http.snippet.Menu.scala code has >>> examples of this. >> >> I'm on it already.... > > ..and seem stuck. I have the following menu structure > > M1 > M1.1 > M1.1.1 > M1.1.2 > M1.2 > M2 > M2 > > etc. I can't seem to get all the third level items (M1.1.1, M1.1.2) > unless the active page is M1.1. Even if I put in <lift:Menu.builder > expandAll="true"/>, they're only shown if I select M1.1. > > The code above which yields kid, outputs M1.1 and M1.2 when M1 is > selected. When looking at the data, at seems like the kid.kids for > M1.1 is empty unless I'm on page M1.1. > > What am I missing?
Got some sleep and did a little more tinkering. The following seems to give the expected results val theKids = for { req <- S.request.toList loc <- req.location.toList m <- loc.menu.kids.toList mi <- m.makeMenuItem(List(m.loc)) } yield mi /Jeppe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---