Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
themeDJango
 
                #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
 

...