You are here

function template_preprocess_owl_views in Multipurpose Corporate Profile 8

Prepares variables for Views Owl carousel templates.

Default template: owl-views.html.twig.

Parameters

array $variables: An associative array containing:

  • view: A View object.

File

modules/contrib/owl/owl.module, line 81
Contains owl.module..

Code

function template_preprocess_owl_views(&$variables) {
  $handler = $variables['view']->style_plugin;
  $settings = _owl_format_settings($handler->options);
  $variables['attributes']['data-settings'] = json_encode($settings);
  $variables['attributes']['class'][] = 'owl-slider-wrapper';
  $variables['attributes']['class'][] = 'owl-carousel';
  $attached = array(
    '#attached' => array(
      'library' => array(
        'owl/owl',
      ),
    ),
  );
  render($attached);
  template_preprocess_views_view_unformatted($variables);
}