You are here

public function ParagraphsGridFormatter::settingsSummary in Paragraphs grid 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 EntityReferenceRevisionsEntityFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/ParagraphsGridFormatter.php, line 114

Class

ParagraphsGridFormatter
Plugin implementation of the 'entity reference rendered entity' formatter.

Namespace

Drupal\paragraphs_grid\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $module_config = $this->configFactory
    ->get('paragraphs_grid.settings');
  $grid_config = $this->configFactory
    ->get($module_config
    ->get('gridtype'));
  $options = $grid_config
    ->get('wrapper.grid.options');
  $container = $this
    ->getSetting('container');
  $container = isset($options[$container]) ? $options[$container] : $container;
  $summary[] = $this
    ->t('Grid container: @container', [
    '@container' => $container,
  ]);
  return $summary;
}