You are here

public function GalleryFormatterFormatter::settingsSummary in Gallery formatter 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 ResponsiveImageFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/GalleryFormatterFormatter.php, line 104

Class

GalleryFormatterFormatter
Plugin for galleryformatter.

Namespace

Drupal\galleryformatter\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $settings = $this
    ->getSettings();
  $summary = [];
  if (!empty($settings['slide_style']) || !empty($settings['thumb_style'])) {
    $summary[] = $this
      ->t('Slides style: @value', [
      '@value' => $settings['slide_style'],
    ]);
    $summary[] = $this
      ->t('Thumbnails style: @value', [
      '@value' => $settings['thumb_style'],
    ]);
    $summary[] = $this
      ->t('Gallery style: @value', [
      '@value' => $settings['style'],
    ]);
    $summary[] = $this
      ->t('Modal: @value', [
      '@value' => $settings['modal'],
    ]);
  }
  else {
    $summary[] = $this
      ->t('Customize your options for the jQuery Gallery.');
  }
  return $summary;
}