[Zope] Dynamically render DTML?

Mark N. Gibson mark@kaivo.com
Sat, 16 Sep 2000 22:21:32 -0600 (MDT)


Is it possible to return dtml from python, and have it rendered correctly
on the page?

for example, the python might look like this...


def get_header(somevar=1):
  if somevar==1:
   return '<dtml-var standard_html_header>'
  else:
   return '<dtml-var other_html_header>'


The dtml document in the zodb might look like this...

<dtml-var expr="get_header(1)">  
   Body text....
<dtml-var standard_html_footer>

When this gets rendered, it's as if the dtml document had 
<dtml-var standard_html_header> in place of the get_header call.

I understand how to call external methods from dtml, etc.  I just want
to know if it's possible to get the string returned rendered as dtml.

Mark

---------------
Mark Gibson
Kaivo, Inc.
www.kaivo.com