[ZPT] Structural Logic: Really, It Is...

Clemens Robbenhaar robbenhaar@espresto.com
Tue, 8 Oct 2002 19:17:00 +0200


beno writes:
 > Hi;
 > Although several have tried to help me with this problem, it still remains 
 > unsolved, so I'll restate it. I have the following code:
 > 
 > <font style="font" tal:attributes="style 
 > python:here.sizeCalc(44,here.size(None,  here))" >
 > 
 > This is Page Template <em tal:content="template/id">template id</em>.</font>
 > 
 > ]]or, alternately... [[
 > 
 > <el tal:define="fsize python:here.sizeCalc(44, here.size(None, here))"
 >      tal:attributes="style string:font-size: ${fsize};" >
 > 
 > This is Page Template <em tal:content="template/id">template id</em>.</el>
 > 
 > However, neither of these render what I'm trying to accomplish, namely, 
 > changing the font size by calling a python script (sizeCalc) and passing a 
 > variable (size) as a parameter. What am I missing?

Ah, size is a _variable_, not a function/script/whatever ! 
Why don't You tell ;-)
In the original DTML version this read:

 <dtml-var "sizeCalc(204,size(_.None,_))">

this looks like "size" is a function ...

Maybe Your problem is that You do not have a merged undernamespace in
ZPT as in DTML, but have to be explicit where your thingies live. 
If its a variable defined with tal:define, sometimes a "global" helps.
Well, this time You did not mail an error message, thus its impossible
to guess whats the problem.

Could You please tell what Your "size" is, and where it is defined
normally?