NULL]; $options['tab_type'] = ['default' => 'tabs']; $options['justified'] = ['default' => FALSE]; return $options; } /** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); if (isset($form['grouping'])) { unset($form['grouping']); $form['tab_field'] = [ '#type' => 'select', '#title' => $this->t('Tab field'), '#options' => $this->displayHandler->getFieldLabels(TRUE), '#required' => TRUE, '#default_value' => $this->options['tab_field'], '#description' => t('Select the field that will be used as the tab.'), ]; $form['tab_type'] = [ '#type' => 'select', '#title' => $this->t('Tab Type'), '#options' => [ 'tabs' => $this->t('Tabs'), 'pills' => $this->t('Pills'), 'list' => $this->t('List'), ], '#required' => TRUE, '#default_value' => $this->options['tab_type'], ]; $form['justified'] = [ '#type' => 'checkbox', '#title' => $this->t('Justified'), '#default_value' => $this->options['justified'], '#description' => $this->t('Make tabs equal widths of their parent'), ]; } } }