You are here

function claro_preprocess_views_view_fields__media_library in Drupal 8

Same name and namespace in other branches
  1. 9 core/themes/claro/claro.theme \claro_preprocess_views_view_fields__media_library()

Implements hook_preprocess_views_view_fields().

This targets each rendered media item in the grid display of the media library's modal dialog.

File

core/themes/claro/claro.theme, line 1256
Functions to support theming in the Claro theme.

Code

function claro_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');
  }
}