function template_preprocess_media_library_item

Same name in other branches
  1. 9 core/modules/media_library/media_library.module \template_preprocess_media_library_item()
  2. 8.9.x core/modules/media_library/media_library.module \template_preprocess_media_library_item()
  3. 11.x core/modules/media_library/media_library.module \template_preprocess_media_library_item()

Prepares variables for a selected media item.

Default template: media-library-item.html.twig.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties and children of the element.

File

core/modules/media_library/media_library.module, line 142

Code

function template_preprocess_media_library_item(array &$variables) {
    $element =& $variables['element'];
    foreach (Element::children($element) as $key) {
        $variables['content'][$key] = $element[$key];
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.