[Zope] Rendering PageTemplateFile

Jens Dobberthin jensd@media-meter.de
24 Jun 2003 14:55:02 +0200

...(the last mail was in the wrong thread)...


is there any way to render a page template file that is located on the
hard disk?

Code excerpt in a product:

def foo(self):
   pt = PageTemplateFile('show.zpt', _prefix=skins_prefix)
   print pt     # prints <PageTemplateFile at 0x89c5000>
   return pt()  # --> error

There is nothing wrong with the page template (actually it doesn't
any tals just plain text). (The idea behind this is that I want to
decide which
template to show. So the skins_prefix may change.)

But rendering will fail.

Thanks a lot,


Error Type: AttributeError
Error Value: other

Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Products.cms2.products.documentpool.DocumentPoolIndex, line 73,
in show
Module Shared.DC.Scripts.Bindings, line 252, in __call__
Module Shared.DC.Scripts.Bindings, line 281, in _bindAndExec
Module Shared.DC.Scripts.Bindings, line 1, in ?
Module Shared.DC.Scripts.Bindings, line 232, in _getTraverseSubpath