You are here

function lightgallery_field_formatter_view in Lightgallery 7

Implements hook_field_formatter_view().

File

includes/lightgallery.field.inc, line 265
Contains all hooks and related methods for the lightgallery_formatter field formatter.

Code

function lightgallery_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();

  // Render elements as one piece of markup so that items can be rendered as item list.
  $element[0] = array(
    '#theme' => 'lightgallery_image_formatter',
    '#items' => $items,
    '#entity_type' => $entity_type,
    '#entity' => $entity,
    '#node' => $entity,
    // Left for legacy support.
    '#field' => $field,
    '#display_settings' => $display['settings'],
  );
  return $element;
}