You are here

function fb_instant_articles_display_field_formatter_view in Facebook Instant Articles 7

Same name and namespace in other branches
  1. 7.2 modules/fb_instant_articles_display/includes/field.inc \fb_instant_articles_display_field_formatter_view()

Implements hook_field_formatter_view().

File

modules/fb_instant_articles_display/fb_instant_articles_display.module, line 542
Hook implementations for Facebook Instant Articles Display module.

Code

function fb_instant_articles_display_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {

  // Grab the InstantArticle object we're going to be building up.  If it's not
  // present, it means that a site admin selected an FB IA field formatter for
  // a non-FB IA content type.
  if (isset($entity->fb_instant_articles_display_wrapper)) {

    /** @var \Drupal\fb_instant_articles_display\DrupalInstantArticleDisplay $wrapper */
    $wrapper = $entity->fb_instant_articles_display_wrapper;
    $wrapper
      ->fieldFormatterView($field, $instance, $langcode, $items, $display);
  }
}