function template_preprocess_uikit_view_list in UIkit Components 8
Same name and namespace in other branches
- 8.3 uikit_views/includes/uikit_views.theme.inc \template_preprocess_uikit_view_list()
- 8.2 uikit_views/includes/uikit_views.theme.inc \template_preprocess_uikit_view_list()
- 7.3 uikit_views/templates/uikit_views.theme.inc \template_preprocess_uikit_view_list()
- 7.2 uikit_views/templates/uikit_views.theme.inc \template_preprocess_uikit_view_list()
Prepares variables for UIkit List templates.
Default template: uikit-view-list.html.twig.
Parameters
array $variables: An associative array containing:
- view: A ViewExecutable object.
- rows: The raw row data.
1 string reference to 'template_preprocess_uikit_view_list'
- UIkitViews::getThemeHooks in uikit_views/
src/ UIkitViews.php - Returns the theme hook definition information for UIkit Views.
File
- uikit_views/
includes/ uikit_views.theme.inc, line 61 - Preprocessors and helper functions to make theming easier.
Code
function template_preprocess_uikit_view_list(array &$variables) {
$view = $variables['view'];
$options = $view->style_plugin->options;
$variables['list_attributes'] = new Attribute();
$variables['list_attributes']['class'] = [
'uk-list',
];
if ($options['class'] != 'default') {
$variables['list_attributes']['class'][] = $options['class'];
}
}