You are here

public function MenuLinkBreadcrumbFormatter::settingsSummary in Menu Link (Field) 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/MenuLinkBreadcrumbFormatter.php \Drupal\menu_link\Plugin\Field\FieldFormatter\MenuLinkBreadcrumbFormatter::settingsSummary()

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 FormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/MenuLinkBreadcrumbFormatter.php, line 112

Class

MenuLinkBreadcrumbFormatter
Plugin implementation of the 'menu_link_breadcrumb' formatter.

Namespace

Drupal\menu_link\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  if ($this
    ->getSetting('link_to_target')) {
    $summary[] = $this
      ->t('Links enabled');
  }
  if ($this
    ->getSetting('parents_only')) {
    $summary[] = $this
      ->t('Parents only');
  }
  return $summary;
}