function elevatezoomplus_slick_settings_alter in ElevateZoom Plus 7
Same name and namespace in other branches
- 8 elevatezoomplus.module \elevatezoomplus_slick_settings_alter()
Implements hook_slick_settings_alter().
File
- ./
elevatezoomplus.module, line 142 - Provides ElevateZoomPlus integration.
Code
function elevatezoomplus_slick_settings_alter(array &$build, $items) {
$settings =& $build['settings'];
// Ensures overrides do not break existing Slick logic for other conditions.
if (elevatezoomplus()
->isApplicable($settings)) {
// Forces Slick to always use nav _only if intended to have one.
// Original Slick only considers a nav if count > 1, this is an enforce.
$settings['nav'] = !empty($settings['optionset_thumbnail']);
// Two things to address to with the current Slick logic:
// 1. Tricks count > 1 to negate unslick _only if really 1.
// 2. Required count > 1 to display the item wrapper in an unslick mode.
// Known Slick version which doesn't behave with count 1 is Slick 1.6.0.
$settings['count'] = count($items) == 1 ? 2 : count($items);
}
}