[Zope] Parameter syntax for page template output

Chris Withers chris at simplistix.co.uk
Wed Mar 2 04:51:57 EST 2005


David Pratt wrote:
> Hi.  I am able to capture the content from a page template
> in a Script Python like this:
> 
> template_html = context.some_folder.folder_contents()
> 
> But I have a page template that I am wanting to capture output from that 
> requires parameters passed
> - normally like this after the template name ?id=test_id

Too keep this working identically, you would do:

context.REQUEST.set('id','test_id')
template_html = context.some_folder.folder_contents()


or, you could do:
template_html = context.some_folder.folder_contents(id='test_id')
...if you change occurances such as request/id to request/id|options/id

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope mailing list