You are here

function hook_slick_settings_alter in Slick Carousel 8

Same name and namespace in other branches
  1. 8.2 slick.api.php \hook_slick_settings_alter()
  2. 7.3 slick.api.php \hook_slick_settings_alter()

Modifies Slick HTML settings before being passed to preprocess, or templates.

If you need to override globally to be inherited by all blazy-related modules: slick, gridstack, mason, etc., consider hook_blazy_settings_alter().

Parameters

array $build: The array containing: item, content, settings, or optional captions.

object $items: The \Drupal\Core\Field\FieldItemListInterface items.

See also

\Drupal\blazy\BlazyFormatterManager::buildSettings()

\Drupal\slick\SlickFormatter::buildSettings()

Related topics

File

./slick.api.php, line 572
Hooks and API provided by the Slick module.

Code

function hook_slick_settings_alter(array &$build, $items) {
  $settings =& $build['settings'];

  // Change skin if meeting a particular criteria.
  // See blazy_blazy_settings_alter() at blazy.module for existing samples.
  if ($settings['optionset'] == 'x_slick_for') {
    $settings['skin'] = $settings['entity_id'] == 54 ? 'fullwidth' : $settings['skin'];
  }
}