Embedding, and using Templates to find a template in the templates-hidden folder

23 views
Skip to first unread message

Dan Gravell

unread,
Apr 6, 2017, 6:51:22 AM4/6/17
to Lift
A simple template 'simple-example.html' inside templates-hidden:

<div>
    <div data-lift="embed?what=to-embed"></div>
</div>

When I do:

Templates("templates-hidden" :: "simple-example" :: Nil)

I get exactly the same XML as above. Is there a way to get the to-embed file embedded before it is passed to a CssSel? eager_eval doesn't appear to work when declared on the data-lift attribute.

Thanks,
Dan

Tim Nelson

unread,
Apr 6, 2017, 9:22:09 AM4/6/17
to Lift
Hi Dan,

I believe what you are looking for is S.runTemplate

Tim

ari gold

unread,
Apr 6, 2017, 1:36:10 PM4/6/17
to Lift
Hey there,

eager_eval doesn't work?

This works for me:

data-lift="ReallyCoolSnippet.render?eager_eval=true"

and I think it's what you want...

All the best,

Ari

Dan Gravell

unread,
Apr 7, 2017, 11:02:58 AM4/7/17
to Lift
Thanks, this works, just needed to know the right call!

Ari, I am calling this from within another snippet. AFAIK (now) Templates() just returns the raw XML without performing any evaluation on it.

Dan
Reply all
Reply to author
Forward
0 new messages