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:
> Beginning Scalahttp://
www.apress.com/book/view/1430219890