You are here

protected function SlickManager::buildNavigation in Slick Carousel 8.2

Returns slick navigation with the structured array similar to main display.

1 call to SlickManager::buildNavigation()
SlickManager::preRenderSlickWrapper in src/SlickManager.php
One slick_theme() to serve multiple displays: main, overlay, thumbnail.

File

src/SlickManager.php, line 305

Class

SlickManager
Implements BlazyManagerInterface, SlickManagerInterface.

Namespace

Drupal\slick

Code

protected function buildNavigation(array &$build, array $thumbs) {
  $settings = $build['settings'];
  foreach ([
    'items',
    'options',
    'settings',
  ] as $key) {
    $build[$key] = isset($thumbs[$key]) ? $thumbs[$key] : [];
  }
  $settings = array_merge($settings, $build['settings']);
  $settings['optionset'] = $settings['optionset_thumbnail'];
  $settings['skin'] = $settings['skin_thumbnail'];
  $settings['display'] = 'thumbnail';
  $build['optionset'] = $build['optionset_tn'];
  $build['settings'] = $settings;
  $build['options']['asNavFor'] = "#" . $settings['id'] . '-slider';

  // The slick thumbnail navigation has the same structure as the main one.
  unset($build['optionset_tn']);
  return $this
    ->slick($build);
}