
zopelist at betabug
May 4, 2009, 12:38 AM
Post #4 of 4
(1132 views)
Permalink
|
|
Re: Executing a text file as a ZPT from a product
[In reply to]
|
|
(Sun, May 03, 2009 at 09:26:57AM +0200) Jakob Schou Jensen wrote/schrieb/egrapse: > Im am writing a product and would like to include ZPT's as part of the > product. Is there a way that I can evaluate a piece of text (preferrably > stored as a text file in the product folder) as a ZPT? Yes of course you can - and about every guide on writing your own product shows you how to do it. For example just look at my BetaBoring sample product: http://papakiteliatziar.gr/BetaBoring What you do is use PageTemplateFile: from Products.PageTemplates.PageTemplateFile import PageTemplateFile ... _www= os.path.join(os.path.dirname(__file__), 'www') ... index_zpt = PageTemplateFile(_www+'/index.zpt', globals()) Regards, Sascha _______________________________________________ Zope maillist - Zope [at] zope http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
|