Introduction
This tutorial shows how to use velocity code and conditional statements within your catalog templates to display an item's multimedia. This velocity code example is intended to be used with the catalog templates:
...
.
Sample Code
Code Block | ||
---|---|---|
| ||
#if($item.getMultimedia("Image") && $item.getMultimedia("Image").size() > 0) <a href="$item.getDefaultMultimedia('Image').getViewUrl()" title="$item.getDescription()"> <img src="$baseThumbnailUrl$item.getDefaultMultimedia('Image').getThumbnail(240)" alt="$item.getDescription()" width="240" height="240" /> </a> #else <img src="$baseUrl/assets/images/200x200_default.jpg" alt="Image coming soon"/> #end |
...
This line displays a default image as a place holder until an image can be upload uploaded for the item.