ViewsBootstrapListGroup.php in Views Bootstrap 8.4
File
src/Plugin/views/style/ViewsBootstrapListGroup.php
View source
<?php
namespace Drupal\views_bootstrap\Plugin\views\style;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\style\StylePluginBase;
class ViewsBootstrapListGroup extends StylePluginBase {
protected $usesRowPlugin = TRUE;
protected $usesRowClass = TRUE;
protected function defineOptions() {
$options = parent::defineOptions();
$options['link_field'] = [
'default' => [],
];
return $options;
}
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.'),
];
}
}