You are here

function template_preprocess_views_slideshow_pager_widget in Views Slideshow 8.4

Views Slideshow: pager.

Related topics

File

./views_slideshow.theme.inc, line 199
The theme system, which controls the output of views slideshow.

Code

function template_preprocess_views_slideshow_pager_widget(&$vars) {

  // Add JavaScript settings for the pager type.
  $vars['#attached']['library'][] = 'views_slideshow/widget_info';
  $vars['#attached']['drupalSettings']['viewsSlideshowPager'][$vars['vss_id']] = [
    $vars['location'] => [
      'type' => \Drupal::service('views_slideshow.format_addons_name')
        ->format($vars['settings']['type']),
    ],
  ];

  // Create some attributes.
  $attributes['class'][] = 'widget_pager widget_pager_' . $vars['location'];
  $attributes['id'] = 'widget_pager_' . $vars['location'] . '_' . $vars['vss_id'];
  $vars['widget'] = [
    '#theme' => $vars['view']
      ->buildThemeFunctions($vars['settings']['type']),
    '#vss_id' => $vars['vss_id'],
    '#view' => $vars['view'],
    '#settings' => $vars['settings'],
    '#location' => $vars['location'],
    '#attributes' => $attributes,
  ];
}