record_image — Get an image tag for a record.

View-related functions

Summary

record_image($record, $imageType = null, $props = array())

Get an image tag for a record.

Parameters:
  • $record (Omeka_Record_AbstractRecord|string) –

  • $imageType (string|null) – Image size: thumbnail, etc. Pass null to use admin-configured default size

  • $props (array) – HTML attributes for the img tag

Returns:

string

Usage

Examples

Get the image associated with an individual record, such as a collection or an exhibit. Use the $imageType string to set the image size.

<?php if ($collectionImage = record_image('collection', 'square_thumbnail')): ?>
    <?php echo link_to_collection($collectionImage, array('class' => 'image')); ?>
<?php endif; ?>

See Also