[Zope] Adding ZPT in init method product

Nico de Boer nico@nfg.nl
31 May 2002 13:22:58 +0200


Hello,

Thanks for your ideas. I managed to solve the problem!!!


This is the code:

from Products.PageTemplates import ZopePageTemplate

        self._createZPT(self, 'ZPT_id', 'title', 'content')

    def _createZPT(self, parent, id, title, content):
        """Add a PageTemplate to the News product"""
        parent._setObject(id, ZopePageTemplate.ZopePageTemplate(id, text=content))
	parent._getOb(id).pt_setTitle(title)

Maybe you can use it?

Thanks again.

Greetz Nico