public function ParagraphsWidget::settingsSummary in Paragraphs Sets 8
Returns a short summary for the current widget settings.
If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.
Return value
array A short summary of the widget settings.
Overrides ParagraphsWidget::settingsSummary
File
- src/
Plugin/ Field/ FieldWidget/ ParagraphsWidget.php, line 49
Class
- ParagraphsWidget
- Plugin implementation of 'entity_reference_revisions paragraphs sets' widget.
Namespace
Drupal\paragraphs_sets\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$summary = parent::settingsSummary();
if ($this
->getDefaultParagraphTypeLabelName() !== NULL) {
// Find "Default paragraph type" in summary and replace it.
foreach ($summary as $key => $value) {
if (strpos($value, 'Default paragraph type') !== 0) {
continue;
}
$summary[$key] = $this
->t('Default paragraphs set: @default_paragraph_set', [
'@default_paragraph_set' => $this
->getDefaultParagraphTypeLabelName(),
]);
}
}
return $summary;
}