You are here

function slick_get_thumbnail in Slick Carousel 7.2

Gets the thumbnail image.

4 calls to slick_get_thumbnail()
slick_format_field_collection in includes/slick.field_collection.inc
Formats Field collection data.
slick_format_image in includes/slick.image.inc
Formats core image data.
slick_format_media in includes/slick.media.inc
Formats image/media file data.
slick_format_paragraphs in includes/slick.paragraphs.inc
Formats Paragraphs data.

File

includes/slick.global.inc, line 317
Global functions across Slick field formatters and Views.

Code

function slick_get_thumbnail($thumbnail_style = '', $item = array()) {
  $thumbnail = array();
  if (!empty($thumbnail_style)) {
    $thumbnail = array(
      '#theme' => 'image_style',
      '#style_name' => $thumbnail_style,
      '#path' => $item['uri'],
    );
    foreach (array(
      'alt',
      'height',
      'title',
      'width',
    ) as $data) {
      $thumbnail["#{$data}"] = isset($item[$data]) ? $item[$data] : NULL;
    }
  }
  return $thumbnail;
}