/**
* {@inheritdoc}
*/
public function buildOptionsForm(&
$form, FormStateInterface
$form_state) { parent::
buildOptionsForm($form,
$form_state);
$form['view_mode'
] =
[ '#type' => 'select',
'#title' =>
$this->
t('Display type'
),
'#options' =>
$this->
buildOptionsForm_summary_options(),
'#default_value' =>
$this->options
['view_mode'
],
];
} /**
* Return the main options, which are shown in the summary title.
*/
public function buildOptionsForm_summary_options() { $view_modes =
$this->entityDisplayRepository->
getViewModes($this->entityTypeId
);
$options =
[];
foreach ($view_modes as $mode =>
$settings) {