[ZPT] An easier question ...

Lynn Walton waltonl@franklin.edu
Thu, 31 May 2001 02:10:09 -0500


I realize my first post is the kind of question that might take some
time to answer, and since I'm so eager ( translate - behind schedule on
project <g>)  I thought I'd ask an easier question.

If I have  a master template like the example master_page and another PT
(like the use_master example) that uses the main macro in the
master_page, can I set/define a variable to a value in the use_master
that the master_page "looks for" with a tal:condition statement  to
determine if to do something?

If so how would I do it.  What would setting the variable to a value in
the uses_page look like, and what would the tal:condition look like? I'm
confused on here/...  vs  template/...  vs some other way?  etc.

I tried
<span tal:define="global myVar string:myString"></span>  in the
use_master page
but nothing I put in the master_page  seems to "get it".  I've tried
things like
  tal:condition="python: template.myVar == 'the string I want to
compare'"
  tal:condition="python: here.myVar == 'the string I want to compare'"

Also,  for me, here/title is always evaluating to nothing, even when I
have the title property set on both the master_page and uses_page (to
two different values).   Should it give me the title from master_page or
use_master page if I'm viewing use_master ?  It gives neither, so I'm
confused.
If master_page has template/title it gives me the one in the use_master
template if that's what I'm viewing.  But shouldn't here/title work too?
If not, can someone explain to me when/how here works?

I know the spec says here is the object to which the template is being
applied.  But if I were viewing use_master wouldn't use_master be the
obect to which the master_page is being applied?  So in that context,
shouldn't here/title and template/title be the same?

Thanks,
Lynn