Sunday, November 14, 2010

Lift: including and embedding templates

For some reason I am incapable of remembering that it's lift:embed and not lift:include, so I'm writing it down. Along the same lines, I can never remember how to change the evaluation order of a snippet call (is it even called a 'snippet call'?). Examples follow.

Embedding a fragment of HTML in a template

<lift:embed what="path/to/fragment"/>
<!-- 
  DO NOT add .html to the what= part 
  what= is relative to src/main/webapp in source tree 
-->

Embedding a fragment of HTML containing lift bindings in a template

<lift:MySnippet.foo eager_eval="true">
  <lift:embed what="path/to/fragment_with_bindings"/>
</lift:MySnippet.foo>

References

3 comments:

  1. Hey Mark,
    I was working on project of comparing dslr's and stumbled upon snapsort.com and was really impressed with the content you provide. Wanted to get in touch with you guys. Is it possible.

    Thanks,
    Amit

    ReplyDelete
  2. Hi, Amit. Thanks for the comment. Send me an email: mark at snapsort . com and we'll discuss there (rather than here in Blogger comments). Thanks.

    ReplyDelete
  3. Hey Mark,

    I sent you an email. Did you receive that ?

    Thanks,
    Amit

    ReplyDelete