[Zope] progammatically add a Page Template

Felix Ulrich-Oltean felix@chaptereight.com
Mon, 30 Sep 2002 10:07:19 +0100


On Wed, Sep 25, 2002 at 05:45:28PM -0500, Mark McEahern wrote:
> How do I programmatically add a Page Template to a folder in Zope? 

Something like this should work in a python script:

folder.manage_addProduct['PageTemplates'].manage_addPageTemplate('newTemplateId',
title='My Shiny New Template')


If you're writing a python product, you can do it by importing
Products.PageTemplates.ZopePageTemplate and using something shorter
like:

ZopePageTemplate.manage_addPageTemplate(folder, id, title, etc...)

Hope this makes sense,

Felix.