[Zope] Render a string as tal

Dieter Maurer dieter at handshake.de
Tue Nov 15 13:17:25 EST 2005


Mark Gibson wrote at 2005-11-14 13:19 -0700:
>I would like to be able to render an arbitrary string as tal, having the
>tal statements evaluated correctly.
>
>How would I go about doing this?

You create a "Products.PageTemplates.ZopePageTemplate.ZopePageTemplate"
with the string as "text", put it into the acquisition context
by a call to its "__of__(context)" method (this defines 'here',
'container', 'request', ...) and then call it.

You can do this in trusted code only...


-- 
Dieter


More information about the Zope mailing list