You are here

public function ParagraphsAnchorPlugin::settingsSummary in Paragraphs Collection 8

Returns a short summary for the current behavior settings.

Parameters

\Drupal\paragraphs\Entity\Paragraph $paragraph: The paragraph.

Return value

string[] The plugin settings.

Overrides ParagraphsBehaviorBase::settingsSummary

File

modules/paragraphs_collection_demo/src/Plugin/paragraphs/Behavior/ParagraphsAnchorPlugin.php, line 95

Class

ParagraphsAnchorPlugin
Provides a Paragraphs Anchor plugin.

Namespace

Drupal\paragraphs_collection_demo\Plugin\paragraphs\Behavior

Code

public function settingsSummary(Paragraph $paragraph) {
  $summary = [];
  if ($anchor = $paragraph
    ->getBehaviorSetting($this
    ->getPluginId(), 'anchor')) {
    $summary = [
      [
        'label' => $this
          ->t('Anchor'),
        'value' => 'scrollto-' . $anchor,
      ],
    ];
  }
  return $summary;
}