[Zope] Rendering PageTemplateFile

Jens Dobberthin jensd@media-meter.de
24 Jun 2003 12:39:13 +0200


Salut,

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 contain
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,
Jens.


Appendix

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