You are here

function _elevatezoomplus_preprocess_slider in ElevateZoom Plus 8

Overrides variables for theme_[slick|splide]().

2 calls to _elevatezoomplus_preprocess_slider()
elevatezoomplus_preprocess_slick in ./elevatezoomplus.module
Overrides variables for theme_slick().
elevatezoomplus_preprocess_splide in ./elevatezoomplus.module
Overrides variables for theme_splide().

File

./elevatezoomplus.module, line 143
Provides ElevateZoomPlus integration.

Code

function _elevatezoomplus_preprocess_slider(&$variables) {
  $settings = $variables['settings'];
  if (elevatezoomplus()
    ->isApplicable($settings) && isset($settings['display']) && $settings['display'] == 'main') {
    $start = isset($variables['js'], $variables['js']['initialSlide']) ? $variables['js']['initialSlide'] : 0;
    $start = isset($variables['options'], $variables['options']['start']) ? $variables['options']['start'] : $start;
    $variables['attributes']['data-initial-zoom'] = $start;
  }
}