[Zope] [Fwd: TALs Expressions]
Brian Brinegar
brinegar at purdue.edu
Fri Jan 28 09:46:37 EST 2005
Please explain, I've got this page template, with an empty title.
<h2 tal:condition="template/title">Has a Title</h2>
<h2 tal:condition="template/id">Has an Id</h2>
<h2 tal:condition="template/title | template/id">Has a Title or Id</h2>
The rendered out put is:
<h2>Has an Id</h2>
So...
<h2 tal:condition="template/title">Has a Title</h2>
The tag is omitted because there is no title, which is what I would
expect (empty string evaluates to false).
<h2 tal:condition="template/id">Has an Id</h2>
The tag is included because there is an Id, again what I would expect.
<h2 tal:condition="template/title | template/id">Has a Title or Id</h2>
The tag is omitted (what???) but there is an id, I would expect this to
evaluate to true (false | true == true). (In fact.. anything to the
right of the pipe is not even accessed/called)
Is there something wrong in my thinking?
-Brian
More information about the Zope
mailing list