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%
Author: Thor
Revision: 1.1
You cannot comment on this entry