Jeppe> We've made primary/secondary navigation where primary navigation is ...
I did something similar..found it difficult to work with the default snippets. But found it hard, when writing my own group snippet, to identify the current Loc within the LocGroups Locs. So Jeppe, would be very interested in your code for that snippet. Mine is below (only slightly modified from Menu.group). But it's not yet quite there. I also had a fiendish problem (lift 1.0.2 scala 2.7.5) when trying to use attributes li:class="x" li_item:class="y" on the tag. Isn't that a standard technique? Does it work for everyone else? For me, Scala chokes on that with a syntax error (further experiments suggest that it doesn't like two attributes with same name and different prefix, perhaps also because BOTH prefixes are from an unknown namespace). Of course it doesn't show you the exact error but faults with an IllegalArgumentException on scala.io.Source, but this has been discussed elsewhere. Anyway, that's why I have the new unprefixed attributes in the code below. def menuGroup(template: NodeSeq): NodeSeq = { val a_attrs = S.prefixedAttrsToMetaData("a") val li_attrs = S.attr("normalclass") match { case Full(c: String) => new UnprefixedAttribute("class", c, Null); case _ => Null } val li_sel_attrs = S.attr("selectedclass") match { case Full(c: String) => new UnprefixedAttribute("class", c, Null); case _ => Null } val currentLoc = LiftRules.siteMap.open_!.findLoc (S.request.open_!) openOr null for (group <- S.attr("group").toList; siteMap <- LiftRules.siteMap.toList; loc <- siteMap.locForGroup(group); link <- loc.createDefaultLink; linkText <- loc.linkText) yield { val a = <a href={link}>{linkText}</a> % a_attrs var li: Elem = <li>{a}</li> if (loc == currentLoc) li % li_sel_attrs else li % li_attrs } } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---