[ZPT] Simple Variable Call

beno zope@thewebsons.com
Sun, 01 Dec 2002 18:55:19 -0400


At 11:39 PM 12/1/2002 +0100, you wrote:
>beno writes:
>  > Here's two lines of code from a Page Template:
>  >
>  > This is Page Template <em tal:content="template/id">template 
> id</em>.<br><br>
>  > <p tal:replace="structure
>  > python:here.theFrame(here.size(),`here.template.id`)" />
>  >
>  > In the latter line I want to call the same_variable referenced in the
>  > former line (template/id or template.id). How do I do it?
>I usually use:
>
>   <...
>     tal:define="templateId      template/id;"
>     tal:replace="... templateId ..."
>   >
>
>i.e. introduce an auxiliary variable definition.
>
>But the "path" function will do the same effect "path('template/id')".
>
>When you resolve "template/id" (or other path expressions) yourself,
>you need to know lots of things. Usually, I try to avoid this road.

I went with:
python:here.theFrame(here.size(),template.id)" />
and that worked fine. The whole idea here was to use a variable that was 
constantly changing and just duplicate pages based on the change. Works 
well :))
Thanks,
beno