gnaa, i had a caching problem with this one.. the problem is the first
argument to processSurroundAndInclude.. still.. ;)

On Aug 7, 12:47 am, fbettag <fr...@bett.ag> wrote:
>         def render(inContentid: String): LiftResponse = {
>                 val content = Content.find(By(Content.id, 
> inContentid.toLong)) match
> {
>                         case Full(obj) => obj
>                         case _ => return NotFoundResponse()
>                 }
>
>                 val layout = Layout.find(By(Layout.id, content.layout)) match 
> {
>                         case Full(obj) => obj
>                         case _ => return NotFoundResponse()
>                 }
>
>                 val sess = S.session match {
>                         case Full(obj: LiftSession) => obj
>                         case _ => return InternalServerErrorResponse()
>                 }
>
>                 val res = sess.processSurroundAndInclude(
>                                         layout.layout,
>                                           <lift:surround at="content">
>                                                 
> <p>{XML.loadString(content.content)}</p>
>                                           </lift:surround>
>                                 )
>
>                 XhtmlResponse(res.first, Empty, Nil, Nil, 200, true)
>         }
>
> this works very nicely!
>
> On Aug 7, 12:18 am, fbettag <fr...@bett.ag> wrote:
>
>
>
> > marius, do you have any idea what i could pass lift:surround's with=""
> > attribute?
>
> > On Aug 6, 11:31 pm, fbettag <fr...@bett.ag> wrote:
>
> > > The CMS is my exactly my usecase. I'll try my luck with
> > > processSurroundAndInclude.
>
> > > On Aug 6, 11:07 pm, Derek Chen-Becker <dchenbec...@gmail.com> wrote:
>
> > > > It might be nice to make template loading configurable. Currently,
> > > > TemplateFinder is used to load templates and it, in turn, uses
> > > > LiftRules.finder to locate a resource by name from the classloader. I 
> > > > think
> > > > that we could add a layer of indirection there to allow someone to use a
> > > > partial function to determine where a template is loaded from, and 
> > > > provide a
> > > > default impl that represents the current behavior. I'm thinking 
> > > > something
> > > > like
>
> > > > PartialFunction[(List[String],String),Box[NodeSeq]]
>
> > > > One possible use would be for something like a CMS, with the template 
> > > > stored
> > > > in a database. Thoughts?
>
> > > > Derek
>
> > > > where List[String] is the template path and the second String is the ISO
> > > > Language code.
>
> > > > On Thu, Aug 6, 2009 at 2:12 PM, fbettag <fr...@bett.ag> wrote:
>
> > > > > Hi there,
>
> > > > > i was just wondering how one would go about dynamifying templates?
> > > > > Atm i store them on disk.
>
> > > > > Is there any way to parse a template and execute all the lift:MyStuff
> > > > > in that template?
> > > > > Like Xml.load but the way lift does it to render stuff in it.
>
> > > > > I tried to find it in code but didn't succeed.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to