progammatically add a Page Template
How do I programmatically add a Page Template to a folder in Zope? I'm basing my attempts off of: /zope/utilities/load_site.py This has various instances of: call(object.manage_addXXX, id=name, XXX) e.g., call(object.manage_addDTMLDocument, id=name, title=title, file=body) How do I add a Page Template in a similar manner? I've tried: call(object.manage_addZopePageTemplate, id=name) But that gives me a not found error, indicating I'm not using the correct method name. Thanks, // mark -
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.
[Felix Ulrich-Oltean [mailto:felix@chaptereight.com]]
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...)
Thanks for the suggestion, Felix. Cheers, // mark -
participants (2)
-
Felix Ulrich-Oltean -
Mark McEahern