You are here

public function SlickAdmin::imageStyleForm in Slick Carousel 8

Same name and namespace in other branches
  1. 8.2 src/Form/SlickAdmin.php \Drupal\slick\Form\SlickAdmin::imageStyleForm()
  2. 7.3 src/Form/SlickAdmin.php \Drupal\slick\Form\SlickAdmin::imageStyleForm()

Returns the image formatter form elements.

1 call to SlickAdmin::imageStyleForm()
SlickAdmin::buildSettingsForm in src/Form/SlickAdmin.php
Returns the main form elements.

File

src/Form/SlickAdmin.php, line 260

Class

SlickAdmin
Provides resusable admin functions, or form elements.

Namespace

Drupal\slick\Form

Code

public function imageStyleForm(array &$form, $definition = []) {
  $definition['thumbnail_style'] = isset($definition['thumbnail_style']) ? $definition['thumbnail_style'] : TRUE;
  $definition['ratios'] = isset($definition['ratios']) ? $definition['ratios'] : TRUE;
  $definition['thumbnail_effect'] = [
    'hover' => $this
      ->t('Hoverable'),
    'grid' => $this
      ->t('Static grid'),
  ];
  if (!isset($form['image_style'])) {
    $this->blazyAdmin
      ->imageStyleForm($form, $definition);
    $form['image_style']['#description'] = $this
      ->t('The main image style. This will be treated as the fallback image, which is normally smaller, if Breakpoints are provided, and if <strong>Use CSS background</strong> is disabled. Otherwise this is the only image displayed. Ignored by Responsive image option.');
  }
  if (isset($form['thumbnail_style'])) {
    $form['thumbnail_style']['#description'] = $this
      ->t('Usages: <ol><li>If <em>Optionset thumbnail</em> provided, it is for asNavFor thumbnail navigation.</li><li>For <em>Thumbnail effect</em>.</li><li>Photobox thumbnail.</li><li>Custom work via the provided data-thumb attributes: arrows with thumbnails, Photoswipe thumbnail, etc.</li></ol>Leave empty to not use thumbnails.');
  }
  if (isset($form['thumbnail_effect'])) {
    $form['thumbnail_effect']['#description'] = $this
      ->t('Dependent on a Skin, Dots and Thumbnail style 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.');
  }
  if (isset($form['background'])) {
    $form['background']['#description'] .= ' ' . $this
      ->t('Works best with a single visible slide, skins full width/screen.');
  }
}