Prepares variables for Views HTML list templates.
Default template: views-view-list.html.twig.
array $variables: An associative array containing:
function template_preprocess_views_view_list(&$variables) {
$handler = $variables['view']->style_plugin;
// Fetch classes from handler options.
$class = explode(' ', $handler->options['class']);
$class = array_map('drupal_clean_css_identifier', $class);
// Fetch wrapper classes from handler options.
$wrapper_class = explode(' ', $handler->options['wrapper_class']);
$wrapper_class = array_map('drupal_clean_css_identifier', $wrapper_class);
// Initialize a new attribute class for $wrapper_class.
if ($wrapper_class) {
$variables['wrapper_attributes'] = new Attribute(array(
'class' => $wrapper_class,
));
}
// Initialize a new attribute class for $class.
$variables['list']['attributes'] = new Attribute(array(
'class' => $class,
));
$variables['list']['type'] = $handler->options['type'];
template_preprocess_views_view_unformatted($variables);
}