You are here

function template_preprocess_views_view_views_fs in Views FractionSlider 8

Prepares vars for views unformatted rows templates.

Default template: views-view-views-fs.html.twig.

Parameters

array $vars: An associative array containing:

  • view: The view object.
  • rows: An array of row items. Each row is an array of content.

File

views_fs/views_fs.theme.inc, line 22
Preprocessors and helper functions to make theming easier.

Code

function template_preprocess_views_view_views_fs(array &$vars) {
  $view = $vars['view'];
  $rows = $vars['rows'];
  $style = $view->style_plugin;
  $options = $style->options;
  foreach ($rows as $id => $row) {
    $vars['rows'][$id] = [];
    $vars['rows'][$id]['content'] = $row;
  }
  $configs = [
    'controls' => $options['controls'],
    'pager' => $options['pager'],
    'dimensions' => $options['views_dimensions'],
    'fullwidth' => $options['views_fullwidth'],
    'responsive' => $options['views_responsive'],
    'increase' => $options['views_increase'],
  ];
  $vars['#attached']['drupalSettings']['view_fs_fractionslider'] = $configs;
}