function MediaThumbnailFormatter::settingsSummary

Same name in other branches
  1. 9 core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\MediaThumbnailFormatter::settingsSummary()
  2. 10 core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\MediaThumbnailFormatter::settingsSummary()
  3. 11.x core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\MediaThumbnailFormatter::settingsSummary()

Overrides ImageFormatter::settingsSummary

File

core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php, line 113

Class

MediaThumbnailFormatter
Plugin implementation of the 'media_thumbnail' formatter.

Namespace

Drupal\media\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
    $summary = parent::settingsSummary();
    $link_types = [
        'content' => $this->t('Linked to content'),
        'media' => $this->t('Linked to media item'),
    ];
    // Display this setting only if image is linked.
    $image_link_setting = $this->getSetting('image_link');
    if (isset($link_types[$image_link_setting])) {
        $summary[] = $link_types[$image_link_setting];
    }
    return $summary;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.