You are here

function template_preprocess_flickity in Flickity Carousel 8

Same name and namespace in other branches
  1. 8.2 theme/flickity.theme.inc \template_preprocess_flickity()
  2. 3.0.x theme/flickity.theme.inc \template_preprocess_flickity()

Template preprocess Flickity variables.

File

theme/flickity.theme.inc, line 13
flickity.theme.inc

Code

function template_preprocess_flickity(&$variables) {

  // Load Flickity settings.
  $group = flickity_settings($variables['settings']);

  // Attach Flickity library.
  $variables['#attached'] = array(
    'drupalSettings' => array(
      'flickity' => array(
        $group['id'] => array(
          'settings' => $group['settings'],
        ),
      ),
    ),
    'library' => array(
      'flickity/local',
      'flickity/settings',
    ),
  );
}