You are here

function popup_onload_theme_suggestions_popup_onload in Popup On Load 8

Implements hook_theme_suggestions_HOOK().

File

./popup_onload.module, line 223
Contains main popup_onload hooks and functions.

Code

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