You are here

public function GridStackViews::buildOptionsForm in GridStack 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/style/GridStackViews.php \Drupal\gridstack\Plugin\views\style\GridStackViews::buildOptionsForm()

Overrides parent::buildOptionsForm().

File

src/Plugin/views/style/GridStackViews.php, line 69

Class

GridStackViews
GridStack style plugin.

Namespace

Drupal\gridstack\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $fields = [
    'captions',
    'layouts',
    'images',
    'links',
    'titles',
    'classes',
  ];
  $definition = $this
    ->getDefinedFieldOptions($fields);
  $this
    ->admin()
    ->buildSettingsForm($form, $definition);
  $count = count($definition['captions']);
  $wide = $count > 2 ? ' form--wide form--caption-' . $count : ' form--caption-' . $count;
  $title = '<p class="form__header form__title">';
  $title .= $this
    ->t('Check Vanilla if using content/custom markups, not fields. <small>See it under <strong>Format > Show</strong> section. Otherwise Gridstack markups apply which require some fields added below.</small>');
  $title .= '</p>';
  $form['opening']['#markup'] = '<div class="form--gridstack form--slick form--views form--half form--vanilla has-tooltip' . $wide . '">' . $title;
  $form['image']['#description'] .= ' ' . $this
    ->t('Be sure to UNCHECK "Use field template" (by default already UNCHECKED) to have it work for Blazy lazyloading. Use Blazy formatters for relevant features such as Colorbox/Photobox/Photoswipe, or multimedia supports.');
}