[Zope] Link to a script from ZPT

Chris Meyers chris@hddesign.com
Tue, 3 Sep 2002 13:45:28 -0500


On Tue, Sep 03, 2002 at 01:28:35PM -0500, Borislav wrote:
> Hi,
> 
> I am having the following problem:
> In a ZPT I have a HTML link that points to a python script. I want to 
> pass a parameter to the script. What is the right TAL expression to call 
>   the script passing it a parameter?
> 
> I tried
> <a tal:attributes="href python:here.myscript('arg')">Link</a>
> but it replaces the href attribute with the output from the script, not 
> what I had in mind...
> 
> I would appreciate your help.
> 

Just pass it as part of the URL to the python script like this

<a tal:attributes="href string:pathToPythonScript?foo=${bar}">link</a>

Then in your python script you can get foo through REQUEST.

foo = context.REQUEST.foo

HTH
Chris

> Regards,
> Borislav
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

-- 
Chris Meyers
Huttleston Data Design
7941 Tree Lane Suite 200
Madison WI 53717