[ZPT] question regarding scope of defines

Robert Rottermann robert@redcor.ch
Sat, 19 Jan 2002 13:18:21 +0100


Hi there,
after carefully reading the docs (for once) I come to you with the following
question:

I would like to define variables by "importing" them from a template like
so:
include.pt:
<div tal:define="global picture string:pic.jpg"
tal:replace="nothing"></div>

useinclude.pt:
<html>
<body>
  <span tal:replace="here/include.pt"></span>
  <img tal:attributes="src picture">
</body>
</html>

If I run that I get an error, that picture is not defined.
Error Type: Undefined
Error Value: "picture" not found in "picture"



Am I trying to do something tal is not meant for, or is there some other way
to have the value of an variable defined outside of the actual template?

thanks for your time
Robert
www.redcor.ch