Thanks, Derek and Jeppe, your responses were very helpful. I
implemented Jeppe's solution and added my own snippet tag within
_viewTemplate.  Unfortunately, I spent the whole day trying to figure
out how pass the current CRUDified object to my snippet. Do I retrieve
it in _viewTemplate from S.params and add an attribute to the snippet
tag? Or just retrieve it from S in the snippet? I think I'm missing
something fundamental with the S object and snippets. As you can tell,
I'm very new to Lift! Any advice is much appreciated.

Peter

On Jun 24, 11:01 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> On 24 Jun 2009, Peter Robinett wrote:
>
> > Hi all,
>
> > I'm using CRUDify on one of my models and I'd like to display some
> > additional data on the view template. I believe that I need to
> > override one of the model definitions with some sort of reference to
> > my own XHTML file. Which one? _viewTemplate? Or perhaps the
> > viewTemplate method?
>
> If you look at the source to CRUDify, you'll see
>
> def viewTemplate(): NodeSeq = pageWrapper(_viewTemplate)
>
> where
>
> def pageWrapper(body: NodeSeq): NodeSeq =
>   <lift:surround with="default" at="content">
>     {
>       body
>     }
>   </lift:surround>
>
> def _viewTemplate =
>   <lift:crud.view>
>     <table id={viewId} class={viewClass}>
>       <crud:row>
>         <tr>
>           <td><crud:name/></td>
>           <td><crud:value/></td>
>         </tr>
>       </crud:row>
>     </table>
>   </lift:crud.view>
>
> So the simplest thing is to override _viewTemplate with something similar
> to the above. This should be done on the companion objects where CRUDify
> is mixed in....
>
> /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
-~----------~----~----~----~------~----~------~--~---

Reply via email to