[Lift] Re: Rendering a template bit
What you want can be done with very basic usage of snippets (the way that templates interface with code in Lift). In your template: lift:YourSnippet.foo/ Then in YourSnippet.scala: class YourSnippet { def foo(xhtml: NodeSeq) = Site.render() } Make sure render returns a NodeSeq. -harryh On Nov 5, 9:35 pm, DFectuoso santiago1...@gmail.com wrote: I want to do the following pattern, i don't know how(or if its possible) to do it in lift: - I want any part of my code to call a Site.render() where site is a model and render is a function inside that model that will print it the information - I want the xhtml to be in a html file so that any designer/html guy can play with it and its css/html. (also they won't have to compile and/or scala:cc after every change). Is this possible? I was playing with the lift:embed what=/commons/site / and sending parameters, but i didn't know how to catch those params in the xml, has anyone done this pattern? Am i trying to solve something that can be solved other pattern? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Lift] Re: Rendering a template bit
The thing is that i want the NodeSeq to reside in a html file, not inside the model. On Nov 5, 10:20 pm, harryh har...@gmail.com wrote: What you want can be done with very basic usage of snippets (the way that templates interface with code in Lift). In your template: lift:YourSnippet.foo/ Then in YourSnippet.scala: class YourSnippet { def foo(xhtml: NodeSeq) = Site.render() } Make sure render returns a NodeSeq. -harryh On Nov 5, 9:35 pm, DFectuoso santiago1...@gmail.com wrote: I want to do the following pattern, i don't know how(or if its possible) to do it in lift: - I want any part of my code to call a Site.render() where site is a model and render is a function inside that model that will print it the information - I want the xhtml to be in a html file so that any designer/html guy can play with it and its css/html. (also they won't have to compile and/or scala:cc after every change). Is this possible? I was playing with the lift:embed what=/commons/site / and sending parameters, but i didn't know how to catch those params in the xml, has anyone done this pattern? Am i trying to solve something that can be solved other pattern? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Lift] Re: Rendering a template bit
DFectuoso santiago1...@gmail.com writes: The thing is that i want the NodeSeq to reside in a html file, not inside the model. Have a look at TemplateFinder.findAnyTemplate, it will load the template from file. If you want to process a complete template, look at S.runTemplate /Jeppe --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---