You are here

function template_preprocess_media_gallery in Media Gallery 8

Prepares variables for media gallery templates.

Default template: media-gallery.html.twig.

Parameters

array $variables: An associative array containing:

  • elements: An associative array containing the media gallery information and any fields attached to the entity.
  • attributes: HTML attributes for the containing element.

File

./media_gallery.module, line 43
Provides a media gallery entity type.

Code

function template_preprocess_media_gallery(array &$variables) {
  $variables['media_gallery'] = $variables['elements']['#media_gallery'];
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
}