David, Here's my scenario. I've got about 30 menus organized into about 7 or 8 groups. Thanks to help from you and Derek and others in this discussion, I can display nested menus in groups as a horizontal superfish menu.
Using URL Rewriting, as described in the master lift book, I created a method: def rewrite:LiftRules.RewritePF = { //Services case RewriteRequest( ParsePath(List("services"),_,_,_),_,_) => RewriteResponse("content" :: Nil, Map("tag" -> "services")) case RewriteRequest( ParsePath(List("services","coreguard"),_,_,_),_,_) => RewriteResponse("content" :: Nil, Map("tag" -> "coreguard")) case RewriteRequest( ParsePath(List("services","estatePlanning"),_,_,_),_,_) => RewriteResponse("content" :: Nil, Map("tag" -> "estatePlanning")) case RewriteRequest( .... ... } That sends all my requests to a content.html template: <lift:surround with="default" at="content"> <span><h3><lift:MySnippets.content> <c:title/> </lift:MySnippets.content> </h3></span> </lift:surround> The snippet is just as riduculously simple: def content(xhtml:NodeSeq):NodeSeq = { val c = S.param("tag") openOr "" bind("c", xhtml, "title" -> S.?(c)) } This navigation works, though is repititious. It would be relatively easy to extend this idea to generate menus, complete with navigation, programatically (say, from an xml file or a data table) and allow site administrators and other users to drag-and-drop menus as desired. The point of all this, in my view, is to eventually populate content.html with data/documents/templates/atom feeds, whatever, with nothing more than the RewriteResponse Map parameter, and voila, you have a fledgling CMS built with relatively few lines of code. If you have some alternative ideas for creating a programatic navigation system, I would be very interested. Glenn... On Jun 12, 2:39 pm, David Pollak <feeder.of.the.be...@gmail.com> wrote: > On Fri, Jun 12, 2009 at 10:44 AM, glenn <gl...@exmbly.com> wrote: > > > RewriteRequest isn't working in my app, so I must be doing something > > wrong, or leaving something important out. > > > I have a menu in my siteMap: > > > Menu(Loc("contact", List("info", "contact"), "Contact Us", LocGroup > > ("info"))) > > > My boot.scala contains this: > > > LiftRules.rewrite.append { > > case RewriteRequest( > > ParsePath(List("info","contact"),_,_,_),_,_) => > > RewriteResponse("content" :: Nil, Map("tag" -> > > "contact")) > > ... > > } > > > And I have a content.html page in webapp. > > I think there's a better way to achieve what you want... lemme know together > some code for you. > > > > > Clicking on the "Contact Us" menu returns an HTTP 403 error, not > > content.html. > > > Any help would be appreciated. > > > Glenn... > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Git some:http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---