Modify contents of a page template through a python script
I need to modify the contents of a page template through a python script. Or create a new page template object with content specified in the python script. Thanks. -- View this message in context: http://www.nabble.com/Modify-contents-of-a-page-template-through-a-python-sc... Sent from the Zope - General mailing list archive at Nabble.com.
+-------[ rieh25 ]---------------------- | | I need to modify the contents of a page template through a python script. Or | create a new page template object with content specified in the python | script. Thanks. No you don't d8) You can simply pass a variable into a page template and render it, even if it's the whole page. Not sure WHY you'd want to, but, you can.. -- Andrew Milton akm@theinternet.com.au
The reason why I need this is because I'm working in an application that controls various aspects of applications (menu's, security, forms, etc.), and wanted to automatically generate zpt's too. But I do need to alter the actual zpt's (that way they are customizable through variables, in regards to aspects that are extraneous to the functionality of my application). -- View this message in context: http://www.nabble.com/Modify-contents-of-a-page-template-through-a-python-sc... Sent from the Zope - General mailing list archive at Nabble.com.
----- Original Message ----- From: "rieh25" <robertoedwins@gmail.com> To: <zope@zope.org> Sent: Thursday, May 03, 2007 3:14 PM Subject: Re: [Zope] Modify contents of a page template through a python script
The reason why I need this is because I'm working in an application that controls various aspects of applications (menu's, security, forms, etc.), and wanted to automatically generate zpt's too. But I do need to alter the actual zpt's (that way they are customizable through variables, in regards to aspects that are extraneous to the functionality of my application).
Have a look at the pt_editAction method of Products.PageTemplates module. Jonathan
Thanks for the help. I found it's done with .pt_edit(text, content_type) -- View this message in context: http://www.nabble.com/Modify-contents-of-a-page-template-through-a-python-sc... Sent from the Zope - General mailing list archive at Nabble.com.
rieh25 wrote:
The reason why I need this is because I'm working in an application that controls various aspects of applications (menu's, security, forms, etc.), and wanted to automatically generate zpt's too. But I do need to alter the actual zpt's (that way they are customizable through variables, in regards to aspects that are extraneous to the functionality of my application).
Twiddler might be better suited to this: http://www.simplistix.co.uk/software/python/twiddler cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (4)
-
Andrew Milton -
Chris Withers -
Jonathan -
rieh25