You are here

protected function SlickViewsBase::buildSettingsForm in Slick Views 8.2

Same name and namespace in other branches
  1. 7.3 src/Plugin/views/style/SlickViewsBase.php \Drupal\slick_views\Plugin\views\style\SlickViewsBase::buildSettingsForm()

Build the Slick settings form.

2 calls to SlickViewsBase::buildSettingsForm()
SlickGrouping::buildOptionsForm in src/Plugin/views/style/SlickGrouping.php
Overrides parent::buildOptionsForm().
SlickViews::buildOptionsForm in src/Plugin/views/style/SlickViews.php
Overrides parent::buildOptionsForm().

File

src/Plugin/views/style/SlickViewsBase.php, line 102

Class

SlickViewsBase
The base class common for Slick style plugins.

Namespace

Drupal\slick_views\Plugin\views\style

Code

protected function buildSettingsForm(&$form, &$definition) {
  $count = count($definition['captions']);
  $definition['captions_count'] = $count;
  $this
    ->admin()
    ->buildSettingsForm($form, $definition);

  // @todo remove custom classes for Blazy 2.x and 1.x updates.
  $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 slick markups apply which require some fields added below.</small>');
  $title .= '</p>';
  $form['opening']['#markup'] = '<div class="form--slick form--views form--half form--vanilla has-tooltip' . $wide . '">' . $title;
  if (isset($form['image'])) {
    $form['image']['#description'] .= ' ' . $this
      ->t('Use Blazy formatter to have it lazyloaded. Other supported Formatters: Colorbox, Intense, Responsive image, Video Embed Field, Youtube Field.');
  }
  if (isset($form['overlay'])) {
    $form['overlay']['#description'] .= ' ' . $this
      ->t('Be sure to CHECK "<strong>Style settings > Use field template</strong>" _only if using Slick formatter for nested sliders, otherwise keep it UNCHECKED!');
  }

  // Bring in dots thumbnail effect normally used by Slick Image formatter.
  $form['thumbnail_effect'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Dots thumbnail effect'),
    '#options' => [
      'hover' => $this
        ->t('Hoverable'),
      'grid' => $this
        ->t('Static grid'),
    ],
    '#empty_option' => $this
      ->t('- None -'),
    '#description' => $this
      ->t('Dependent on a Skin, Dots and Thumbnail image options. No asnavfor/ Optionset thumbnail is needed. <ol><li><strong>Hoverable</strong>: Dots pager are kept, and thumbnail will be hidden and only visible on dot mouseover, default to min-width 120px.</li><li><strong>Static grid</strong>: Dots are hidden, and thumbnails are displayed as a static grid acting like dots pager.</li></ol>Alternative to asNavFor aka separate thumbnails as slider.'),
    '#weight' => -100,
  ];
}