[Zope] rendering ZClass property

Kevin Dangoor kid@kendermedia.com
Tue, 14 Dec 1999 21:48:36 -0500


Hi, Tim

----- Original Message -----
From: "Timothy Wilson" <wilson@visi.com>
To: "Zope listserv" <zope@zope.org>
Sent: Tuesday, December 14, 1999 7:12 PM
Subject: [Zope] rendering ZClass property


> Foo_ and bar_property are both properties of the same ZClass. This seems
> like it should be easy, but I tried (code snippet):
>
> <dtml-if body>
>  <p><b>(a href="/<dtml-var url>/show_article">Read more...</a>)</b></p>
> </dtml-if>
>
> When I try this, the if is apparently evaluating to false for all
> instances because none of them show the "Read more..." text.

The code inside that if would not be executed unless body not only exists,
but evaluates to true. Could that cause a problem?

One thing you can do, if you are strictly concerned about the existence of
something:

<dtml-if "_.has_attr('body')">
blah
</dtml-if>

Kevin