[ic] if file ...

Corey Gilmore interchange-users@lists.akopia.com
Mon May 28 13:23:01 2001


Can anyone see anything wrong with the following snippet?

[if type="file" term="__SMALL_ICONS_IMAGE_DIR__/[item-field category].gif"]
 [then]
  <td><a href="[item-code].html"><img src="__SMALL_ICONS_IMAGE_DIR__/[item-field category].gif" alt="" border="0" width="14" height="14"></a></td>
 [/then]
[else]
 <td><a href="[item-code].html"><img src="__SITEPIECES_IMAGE_DIR__/1pix.gif" alt="" border="0" width="14" height="14"></a></td>
[/else]
[/if]

__SMALL_ICONS_IMAGE_DIR__ __SITEPIECES_IMAGE_DIR__ are all valid variables
set in my catalog.cfg, item-field catagory is a custom field I added.

This is from my results.html

Basically, the problem lies in the if statement.  I tried using
[if file __SMALL_ICONS_IMAGE_DIR__/[item-field category].gif]
And that always returned true.  The if statement above, always returns
false.  I know that the path for both images is valid, because (depending
on which 'if' statement i am using) I either get a 14x14 clear gif, or my
category icon.

Basically
[if type="file" interpolate="1" term="__SMALL_ICONS_IMAGE_DIR__/[item-field category].gif"]
returns false
[if interpolate=1 file "__SMALL_ICONS_IMAGE_DIR__/[item-field category].gif"]
returns true
[if type="file" term="__SMALL_ICONS_IMAGE_DIR__/[item-field category].gif"]
returns false
[if file __SMALL_ICONS_IMAGE_DIR__/[item-field category].gif]
returns true

And
[if file /home/httpd/pp/images/site_pieces/small_icons/[item-field category].gif]
Works.

Why can't I use a variable in my if statement?

.cfg