Hello,
I am trying to do something like this:
I want to render a different page based on the name "xxxxx"
www.test.com/guides/awesomeguide
www.test.com/guides/newguide
My approach would be I would have a sitemap like this
Menu.i("guides") / "guides"
-----------------------------------------
guides.html
<div lift:Guides.userGuides> </div>
------------------------------------------------
class Guides{
def userGuides = {
// render different page
}
}
So I would have one snippet which renders me a new page based on the input. I already managed to get the input like this
def howdy() = {
val s = Req.parsePath(S.uri).partPath
println("+++++++ ")
s.foreach(s => println(s))
"#time *" #> date.map(_.toString)
}
I get the url in a list. If the url is /guides/test I would get List("guides","test")
Then I could query my database with the name and render the html page.
But I ran into a small problem. Because lift thinks /guides/test is a html file I always get the error "The Requested URL /index/test was not found on this server" . Which is what I was expecting.
I need a way to tell lift "Hey if you see /guides/ the following thing would be a variable so don't try to look for a html file".
In Play2 (MVC) it looked something like this
/guides/:guideName controllers.Guides.userGuides(guideName: String)
But this is really strange and I couldn't get it to work and I am not quite sure if this is what I want. So for simplicity I just parsed the url into a list.
My best guess would be that it generates somehow a sitemap in "Params" But I don't see the connection between Class ShowParam and object Param. And Param never gets called.
What would you recommend me to look into?