[Zope] ZTemplates without Zope

Oleg Broytmann phd@sun.med.ru
Thu, 1 Apr 1999 18:45:23 +0400 (MSD)


Hi!

On Thu, 1 Apr 1999, Michel Pelletier wrote:
> Hmm.  It seems pretty simple to me.  Perhaps if you post a snip of the
> code you feel is complex we can show you were the trim it, if it needs
> it.

from DocumentTemplate import HTMLFile

template1 = HTMLFile("standard_html_header.dtml")
someKlassObj.standard_html_header = template1( ...some-data-here-to-init-template... )

template2 = HTMLFile("standard_html_footer.dtml")
someKlassObj.standard_html_footer = template2( ...some-data-here-to-init-template... )

someKlassObj.do_some_processing()

template3 = HTMLFile("my_real_page.dtml")
print template3(someKlassObj)

   And my_real_page.dtml contains tags
<!--#var standard_html_header-->
   and
<!--#var standard_html_footer-->

   Do I need to initialize template1 and temlate2 manually every time?

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.