[ic] [if file....] confusion.

Kevin Walsh interchange-users@icdevgroup.org
Thu Aug 22 16:16:02 2002


> 
> From the documentation:
> 
> [if file /home/user/www/images/[item-code].gif]
>     <IMG SRC="[item-code].gif">
> [/if]
> 
> Then why doesn't the following line work?
> 
> [if file /var/lib/interchange/catalogs/hwmpro/images/company-files/[value
> company]/logo/[value company].jpg]
>     <IMG SRC="[value company].jpg">
> [else]
>     /var/lib/interchange/catalogs/hwmpro/images/company-files/[value
> company]/logo/[value company].jpg
> [/if]
> 
> In each case, the if is failing, and the correct string is being displayed
> by the 'else'.
> 
You can't expect tags to get interpolated from within positional
parameters.

Change this:

    [if file /path/[value company].gif]

To this:

    [if type=file term="/path/[value company].gif"]

You are also missing the closing [/else] from your code, by the way.

The reason [item-code] worked is that the "looping tags" are "replaced"
and not "interpolated" like other tags.

The latest version of the documentation has been updated, in the
"if file" section, to try to avoid this sort of confusion.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/