lmorroni
unread,Aug 27, 2010, 2:20:10 PM8/27/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lift
I'm still a novice. I took Menu.scala and modified it to do a few
things I need. One of my goals is to take the current loc, find the
top level loc and then return a NodeSeq of all the first level
children of that top level node. My menus only have two levels.
Maybe I can do this with the existing Menu snippet but I could not
figure it out. I think my question boils down to this: Given any
loc, how do I obtain a NodeSeq representation of all items in the
second level of it's breadCrumb tree? The dead end I always seem to
hit is taking a list of MenuItems and generating the proper NodeSeq
from it.
I called my new function currentKids. For instance:
<ul>
<lift:MorroniMenu.currentKids />
</ul>
And the function(doesn't compile)
def currentKids(template: NodeSeq): NodeSeq = {
val toBind = if ((template \ "bind").filter(_.prefix ==
"menu").isEmpty)
<xml:group><menu:bind/> </xml:group>
else template
val attrs = S.prefixedAttrsToMetaData("a")
for (request <- S.request.toList;
siteMap <- LiftRules.siteMap.toList;
currentLoc <- request.location.toList;
loc <- currentLoc.breadCrumbs.toList take 1
)
yield {
val a = //need This still
Group(bind("menu", toBind, "bind" -> a))
}
}
Any insight from the Jedis would be appreciated.
Larry