You are here

function link_field_formatter_view in Link 7

Implements hook_field_formatter_view().

File

./link.module, line 1306
Defines simple link field types.

Code

function link_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $elements = array();
  foreach ($items as $delta => $item) {
    if (!empty($display['settings']['custom_title'])) {
      $item['title'] = $display['settings']['custom_title'];
    }
    $elements[$delta] = array(
      '#theme' => 'link_formatter_' . $display['type'],
      '#element' => $item,
      '#field' => $instance,
      '#display' => array(
        'settings' => $display['settings'],
      ),
    );
  }
  return $elements;
}