Same name and namespace in other branches
- 8.x-2.x src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php \Drupal\color_field\Plugin\Field\FieldFormatter\ColorFieldFormatterSwatch::settingsSummary()
Fichier
-
src/
Plugin/ Field/ FieldFormatter/ ColorFieldFormatterSwatch.php, line 80
Classe
- ColorFieldFormatterSwatch
- Plugin implementation of the color_field swatch formatter.
Namespace
Drupal\color_field\Plugin\Field\FieldFormatterCode
public function settingsSummary() : array {
$opacity = $this->getFieldSetting('opacity');
$settings = $this->getSettings();
$summary = [];
$summary[] = $this->t('@shape', [
'@shape' => $this->getShape($settings['shape']),
]);
$summary[] = $this->t('Width: @width Height: @height', [
'@width' => $settings['width'],
'@height' => $settings['height'],
]);
if ($opacity && $settings['opacity']) {
$summary[] = $this->t('Display with opacity.');
}
if ($settings['data_attribute']) {
$summary[] = $this->t('Use HTML5 data attribute.');
}
return $summary;
}