public function MediaThumbnailFormatter::settingsSummary in Media entity 8
Returns a short summary for the current formatter settings.
If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.
Return value
string[] A short summary of the formatter settings.
Overrides ImageFormatter::settingsSummary
File
- src/
Plugin/ Field/ FieldFormatter/ MediaThumbnailFormatter.php, line 109
Class
- MediaThumbnailFormatter
- Plugin implementation of the 'media_thumbnail' formatter.
Namespace
Drupal\media_entity\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = parent::settingsSummary();
$link_types = [
'content' => $this
->t('Linked to content'),
'media' => $this
->t('Linked to media entity'),
];
// 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;
}