You are here

function media_gallery_theme_suggestions_media_gallery in Media Gallery 8

Implements hook_theme_suggestions_HOOK().

File

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

Code

function media_gallery_theme_suggestions_media_gallery(array $variables) {
  $suggestions = [];
  $media_gallery = $variables['elements']['#media_gallery'];
  $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
  $suggestions[] = 'media_gallery__' . $sanitized_view_mode;
  $suggestions[] = 'media_gallery__' . $media_gallery
    ->bundle();
  $suggestions[] = 'media_gallery__' . $media_gallery
    ->bundle() . '__' . $sanitized_view_mode;
  $suggestions[] = 'media_gallery__' . $media_gallery
    ->id();
  $suggestions[] = 'media_gallery__' . $media_gallery
    ->id() . '__' . $sanitized_view_mode;
  return $suggestions;
}