3 namespace Drupal\views_bootstrap\Plugin\views\style;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\views\Plugin\views\style\StylePluginBase;
9 * Style plugin to render each item in an ordered or unordered list.
11 * @ingroup views_style_plugins
14 * id = "views_bootstrap_list_group",
15 * title = @Translation("Bootstrap List Group"),
16 * help = @Translation("Displays rows in a Bootstrap List Group."),
17 * theme = "views_bootstrap_list_group",
18 * theme_file = "../views_bootstrap.theme.inc",
19 * display_types = {"normal"}
22 class ViewsBootstrapListGroup extends StylePluginBase {
25 * Overrides \Drupal\views\Plugin\views\style\StylePluginBase::usesRowPlugin.
29 protected $usesRowPlugin = TRUE;
32 * Overrides \Drupal\views\Plugin\views\style\StylePluginBase::usesRowClass.
36 protected $usesRowClass = TRUE;
41 protected function defineOptions() {
42 $options = parent::defineOptions();
43 $options['link_field'] = ['default' => []];
50 public function buildOptionsForm(&$form, FormStateInterface $form_state) {
51 parent::buildOptionsForm($form, $form_state);
53 $fields = ['' => $this->t('<None>')];
54 $fields += $this->displayHandler->getFieldLabels(TRUE);
56 $form['title_field'] = [
58 '#title' => $this->t('Title field'),
59 '#options' => $fields,
61 '#default_value' => $this->options['title_field'],
62 '#description' => $this->t('Select the field that will be used as the title.'),