RE: [Zope] ZTemplates without Zope
-----Original Message----- From: Oleg Broytmann [mailto:phd@sun.med.ru] Sent: Thursday, April 01, 1999 2:31 AM To: Zope Mailing List Subject: [Zope] ZTemplates without Zope
Hello!
I am trying to rewrite some of my CGIs using ZTemplates, no Zope yet. I want to clarify some points I do not understand clear. Any help welcome.
Think I will write a DTML file, and there is the tag <!--#var standard_html_header--> As far as I understand, there is no way for DTML to place standard_html_header into a file - aquiring and rendering IDs is a job of Zope, not ZTemplates, right?
Sort of. Aquisition can be used without Zope. If the object you want to *provide* an attribute inherits ExtensionClass.Base, and the object you want to *acquire* an attribute inherits Acquisition.Implicit, then if you access the acquirer in the context of the acquired you can mimic the behavior.
What method I can use? Do I need to create few instances of DocumentTemplate.HTMLfile and call them with different files/objects? Any simpler way?
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. -Michel
Oleg. ---- Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/ Programmers don't die, they just GOSUB without RETURN.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
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.
participants (2)
-
Michel Pelletier -
Oleg Broytmann