Description
item_thumbnail()
returns HTML for a thumbnail image associated with an item. Default parameters will use the first image, but that can be changed by modifying $index.
Usage
<?php echo item_thumbnail(); ?>
Arguments
- Params - An array of parameters. Available parameters include:
- $props: A set of attributes (properties) for the <img /> tag.
- $index (integer): The position of the file to use (starting with 0 for the first file).
- $item: The item to which the image belongs.
Return Values
- The value of item_image as an HTML string.
Examples
The following example works on the items/show.php page. Not all items have an image associated with them, so it is best to check.
<?php if (item_thumbnail()): ?> <?php echo (item_thumbnail()); ?> <?php endif; ?>
Source File
- /applications/helpers/ItemFunction.php in Omeka 1.0.