function media_library_theme_reset_preprocess_views_view_fields__media_library in Media Library Theme Reset 8
Implements hook_preprocess_views_view_fields().
This targets each rendered media item in the grid display of the media library's modal dialog.
File
- ./
media_library_theme_reset.module, line 134 - Contains media_library_theme_reset.module.
Code
function media_library_theme_reset_preprocess_views_view_fields__media_library(array &$variables) {
// Add classes to media rendered entity field so it can be targeted for
// styling. Adding this class in a template is very difficult to do.
if (isset($variables['fields']['rendered_entity']->wrapper_attributes)) {
$variables['fields']['rendered_entity']->wrapper_attributes
->addClass('media-library-item__click-to-select-trigger');
}
}