item_image_gallery
— Get a gallery of file thumbnails for an item.
Summary
- item_image_gallery($attrs = array(), $imageType = 'square_thumbnail', $filesShow = null, $item = null)
Get a gallery of file thumbnails for an item.
- Parameters:
$attrs (
array
) – HTML attributes for the components of the gallery, in sub-arrays for ‘wrapper’, ‘linkWrapper’, ‘link’, and ‘image’. Set a wrapper to null to omit it.$imageType (
string
) – The type of derivative image to display.$filesShow (
bool
) – Whether to link to the files/show. Defaults to null, uses ‘link to file metadata’ appearance option.$item (
Item
) – The Item to use, the current item if omitted.
- Returns:
string
Usage
Examples
Use the $attrs
array to assign HTML attributes for each image in the gallery for an item.
Use 'wrapper'
to set the attributes for gallery block div
:
<?php echo item_image_gallery(
array('wrapper' => array('class' => 'gallery')));
?>
Use 'linkWrapper'
to set the attributes on the div
that surrounds each image:
<?php echo item_image_gallery(
array('wrapper' => array('class' => 'gallery'),
'linkWrapper' => array('class' => 'admin-thumb panel')));
?>
Use 'link'
to set the attributes for the a
tag:
<?php echo item_image_gallery(
array('wrapper' => array('class' => 'gallery'),
'linkWrapper' => array('class' => 'admin-thumb panel'),
'link' => array('class' => 'link')));
?>
Use 'image'
to set the attribute for the img
tag:
<?php echo item_image_gallery(
array('wrapper' => array('class' => 'gallery'),
'linkWrapper' => array('class' => 'admin-thumb panel'),
'link' => array('class' => 'link'),
'image' => array('class' => 'image')));
?>
Omit the default 'wrapper'
attributes by setting it to null:
<?php echo item_image_gallery(
array('wrapper' => null,
'linkWrapper' => array('class' => 'admin-thumb panel'),
'link' => array('class' => 'link'),
'image' => array('class' => 'image')));
?>
Use the $imageType
parameter to set which image derivative is used in the gallery. Available options are square_thumbnail
, thumbnail
, fullsize
, and original
:
<?php echo item_image_gallery(
array('wrapper' => null,
'linkWrapper' => array('class' => 'admin-thumb panel'),
'link' => array('class' => 'link'),
'image' => array('class' => 'image')),
'thumbnail');
?>
Set the $filesShow
boolean to true to link each image file to its file/show page:
<?php echo item_image_gallery(
array('wrapper' => null,
'linkWrapper' => array('class' => 'admin-thumb panel'),
'link' => array('class' => 'link'),
'image' => array('class' => 'image')),
'thumbnail',
true);
?>