[Zope] <dtml-if> question
Hans de Wit
hw@scp.nl
Thu, 22 Feb 2001 13:58:56 MET
Hello,
I am doing something wrong with a dtml-if,
i have been looking for a few hours and i don't understand
what is happening.
What the following code should do is test wheter an image exists and
if it exists render it in the browser. If it doesn't exist it should show an empty
default image. I found two ways to do it and both do it wrong in different ways
<dtml-let foto="'/Cis/fotos/afoto.jpg'">
<dtml-if expr="_.getitem('foto')">
<img src="&dtml-foto;">
<dtml-else>
<img src="/Cis/fotos/Noface.jpg">
</dtml-if>
<dtml-if &dtml-foto;>
<img src="&dtml-foto;">
<dtml-else>
<img src="/Cis/fotos/Noface.jpg">
</dtml-if>
</dtml-let>
The first one allways finds the true in the <dtml-if> and the second one
allways the false. Why is that and what should i change?
Met vriendelijke groeten,
Hans de Wit
h.de.wit@scp.nl