Page template in Python-based product. How?
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? Can I use: Globals.HTMLFile("name", globals()) ? Or do I need to call some other method? Kind regards, René Pijlman
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
participants (1)
-
Rene Pijlman