function MediaThumbnailFormatter::settingsForm

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

Overrides ImageFormatter::settingsForm

File

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

Class

MediaThumbnailFormatter
Plugin implementation of the 'media_thumbnail' formatter.

Namespace

Drupal\media\Plugin\Field\FieldFormatter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
    $element = parent::settingsForm($form, $form_state);
    $link_types = [
        'content' => $this->t('Content'),
        'media' => $this->t('Media item'),
    ];
    $element['image_link']['#options'] = $link_types;
    return $element;
}

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