[ic] thumbnails in results pages: newbie question

interchange-users@interchange.redhat.com interchange-users@interchange.redhat.com
Wed Feb 27 23:52:00 2002


> my question is how can i get thumbnails to show in the results
> page of a search? we'd like that to be the default when a customer
> clicks on a Category on the left nav menu.


Edit results.html and include an image call in the loop:

One way of doing this would be:

<IMG SRC="items/thumb/[item-field thumb]">

Though this would mean you would get a broken image if no value was in the
products database or the image is missing.

To fix this you could add a blank.gif into the thumb field for each product
that is without an image.

Another method would be to surround it with an if statement.
Many permutations of this. You could use:

[if file /home/usr/cat/images/thumb/[item-code]_b.jpg]<IMG
SRC="items/thumb/[item-code]_b.jpg">[/if]

In the above example note that this store would need images to be named by
SKU.

You could also do:

[if file /home/usr/cat/images/thumb/[item-field thumb]"><IMG
SRC="items/thumb/[item-field thumb]">[/if]

Finally, just to mention that on a busy catalog 'if' statements in a results
page are more taxing on the server than <IMG SRC="items/thumb/[item-field
thumb]">