function lightning_media_preprocess_views_view_grid in Lightning Media 8.4
Same name and namespace in other branches
- 8 lightning_media.module \lightning_media_preprocess_views_view_grid()
- 8.2 lightning_media.module \lightning_media_preprocess_views_view_grid()
- 8.3 lightning_media.module \lightning_media_preprocess_views_view_grid()
Preprocess function for grid views of the media library.
Parameters
array $variables: Template variables.
File
- ./
lightning_media.module, line 440 - Core media asset support for Lightning.
Code
function lightning_media_preprocess_views_view_grid(array &$variables) {
/** @var \Drupal\views\ViewExecutable $view */
$view = $variables['view'];
if ($view->display_handler
->getPluginId() == 'entity_browser') {
foreach ($variables['items'] as &$item) {
foreach ($item['content'] as &$column) {
$column['attributes']['data-selectable'] = 'true';
}
}
}
}