[Zope-dev] How to concatenate ID + string to check for object?

EvH edward_van_h@bigfoot.com
Sat, 20 Jul 2002 14:15:20 +0200


Hi,

I've done my homework before posting, but can't find a way out: When adding 
articles to my intranet, if an icon exists (eg. if it's an article about 
Zope, I added the Zope icon to ZODB), I will display it in a corner; If no 
icon exists for this article, I'll display a default icon to avoid having 
an empty "IMG" box. I've tried multiple things, but none work. Here's the 
latest trial:

//Zope complains that the first line below is NOK
<dtml-if expr="<dtml-var id>+'.png'">
	<img src="<dtml-var id>.png" border=0>
	//To check that concatenating both strings works
	<dtml-var id>.png
<dtml-else>
	<img src="default_icon.png" border=0>
	<dtml-var id>.png
</dtml-if>

Any idea?
Thx
EvH.