Why is a variable defined outside a fill-slot
or define-macro
element not visible inside this element?
<body tal:define="a string:a">
<metal:content-core fill-slot="content-core">
<metal:content-core define-macro="content-core"
tal:define="b string:b">
<div tal:content="a" />
<div tal:content="b" />
<div tal:content="c" />
</metal:content-core>
</metal:content-core>
</body>
The tales-expression with the variable a
cannot be evaluated. Of course b
is visible.
On the other side, if the variable c
is defined in the enclosing element of define-slot
like the following then it is visible.
<div tal:define="c string:c">
<metal:text define-slot="content-core"></metal:text>
</div>
It looks like the variables are evaluated only after the slot is inserted.