Miva Merchant 5 Module FAQs » Features


{docurl}

Conditionally displaying alternate text and images when data is missing

Not all of my products have thumbnail images. How do I detect when a randomly selected product is missing the thumbnail so that I can display a "missing image" gif?

You can do conditionals in the template modules with:

%begin_if|expression|%
if true
%else%
if false
%end_if%


In this case you would want the expression to test for the length of the thumbnail field.

So try this:

%begin_if|len('%random|thumbnail|01|%')|%
%random|thumbnail|01|%
%else%
display "no image" gif here
eg:
<img src="graphics/no_thumbnail.gif" alt="" />
%end_if%



Last update: 2008-10-14 09:05
Author: Thor
Revision: 1.1

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry