public function ParagraphsSliderPlugin::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/ ParagraphsSliderPlugin.php, line 244
Class
- ParagraphsSliderPlugin
- Provides Slider plugin.
Namespace
Drupal\paragraphs_collection_demo\Plugin\paragraphs\BehaviorCode
public function settingsSummary(Paragraph $paragraph) {
$slider_optionset = $paragraph
->getBehaviorSetting('slider', 'slick_slider');
$all_optionset = $this
->getAllOptionSet();
$summary = [];
if (in_array($slider_optionset, array_flip($all_optionset))) {
$summary = [
[
'label' => $this
->t('Slider settings'),
'value' => $all_optionset[$slider_optionset],
],
];
}
return $summary;
}