You are here

function template_preprocess_flickity_views in Flickity Carousel 8.2

Same name and namespace in other branches
  1. 8 modules/views/theme/flickity_views.theme.inc \template_preprocess_flickity_views()
  2. 3.0.x modules/views/theme/flickity_views.theme.inc \template_preprocess_flickity_views()

Template preprocess Flickity Views variables.

File

modules/views/theme/flickity_views.theme.inc, line 11
flickity_views.theme.inc

Code

function template_preprocess_flickity_views(&$variables) {
  if (!empty($variables['view'])) {
    $items = array();
    foreach ($variables['rows'] as $id => $row) {
      $items[] = array(
        'row' => \Drupal::service('renderer')
          ->render($row),
      );
    }

    // Row items & instance settings.
    $variables['settings'] = $variables['view']->style_plugin->options;
    $variables['items'] = $items;
  }
}