You are here

private function DrupalInstantArticleDisplay::fieldFormatSubtitle in Facebook Instant Articles 7

Formatter for the Subtitle element.

Parameters

$items:

Header $header:

1 call to DrupalInstantArticleDisplay::fieldFormatSubtitle()
DrupalInstantArticleDisplay::fieldFormatterView in modules/fb_instant_articles_display/src/DrupalInstantArticleDisplay.php

File

modules/fb_instant_articles_display/src/DrupalInstantArticleDisplay.php, line 278
Contains \Drupal\fb_instant_articles_display\DrupalInstantArticleDisplay.

Class

DrupalInstantArticleDisplay
Facebook Instant Article node wrapper class. Builds up an InstantArticle object using field formatters.

Namespace

Drupal\fb_instant_articles_display

Code

private function fieldFormatSubtitle($items, $header) {

  // We can only have a single subtitle, so just take the first delta to
  // be the subtitle.
  // @todo do we have to sanitize first, or will FB IA SDK take care of it?
  if (!empty($items[0]['value'])) {
    $header
      ->withSubTitle(strip_tags($items[0]['value']));
  }
}