You are here

public function ViewsBootstrapListGroup::buildOptionsForm in Views Bootstrap 8.4

Same name and namespace in other branches
  1. 8.3 src/Plugin/views/style/ViewsBootstrapListGroup.php \Drupal\views_bootstrap\Plugin\views\style\ViewsBootstrapListGroup::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides StylePluginBase::buildOptionsForm

File

src/Plugin/views/style/ViewsBootstrapListGroup.php, line 50

Class

ViewsBootstrapListGroup
Style plugin to render each item in an ordered or unordered list.

Namespace

Drupal\views_bootstrap\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $fields = [
    '' => $this
      ->t('<None>'),
  ];
  $fields += $this->displayHandler
    ->getFieldLabels(TRUE);
  $form['title_field'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Title field'),
    '#options' => $fields,
    '#required' => FALSE,
    '#default_value' => $this->options['title_field'],
    '#description' => $this
      ->t('Select the field that will be used as the title.'),
  ];
}