18 Jun
2001
18 Jun
'01
9:30 p.m.
I'd like to use Page Templates in a Python-based product instead of DTML templates. How do I add a Page Template to the product?
For the record (and the archive), I'll answer my own question. Looking at the source (PageTemplates/ZopePageTemplate.py) this appears to do the trick: from Products.PageTemplates.PageTemplateFile import PageTemplateFile foo = PageTemplateFile('bar', globals()) The implicit filename extensions is ".zpt", so the filename in this example must be 'bar.zpt' As far as I can tell this works much the same way as Globals.HTMLFile(), as documented in http://www.zope.org/Members/hathawsh/PythonProductTutorial. But please correct me if I'm wrong. Regards, René Pijlman