[Zope] Re: passing args from zpt to zpt

Tonico Strasser contact_tonico at yahoo.de
Thu May 13 09:14:45 EDT 2004


Roy Mathew wrote:

> Folks,
> 
> Does anyone know if there is a way to pass arguments from a Page Template to
> another?
> The only way I can think of is to use SESSION to hold the values, and this
> seems
> clunky as I am then forced to remove those arguments from SESSION after.
> 
> I need to do something like:
> 
>   <!-- my main.pt is as follows -->
>   <span tal:define="global length python:23">
>     <metal:block tal:replace="structure here/nested.pt"/>
>   </span>
>   
>   <!-- and nested.pt looks like this -->
>   <b tal:content="length|string:nothing was passed down"/>
>

Either you define a macro in nested.pt and use that, or you can call 
nested.pt with options:

   <span tal:define="length python:23">
     <metal:block tal:replace="structure python: 
here['nested.pt'](length=length)"/>
   </span>

In nested.pt you can refer it with 'options/length'.

HTH

Tonico




More information about the Zope mailing list