Hi everyone, I'm trying to diplay a property of a ZClass based on whether another property exists or not. In essence: if foo_property exists print bar_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. Ideas? -Tim -- Timothy Wilson | "The faster you | Check out: Henry Sibley H.S. | go, the shorter | http://slashdot.org/ W. St. Paul, MN, USA | you are." | http://linux.com/ wilson@visi.com | -Einstein | http://www.mn-linux.org/
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
participants (2)
-
Kevin Dangoor -
Timothy Wilson