You are here

function easy_email_theme_suggestions_easy_email in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x easy_email.module \easy_email_theme_suggestions_easy_email()

Implements hook_theme_suggestions_HOOK().

File

./easy_email.module, line 82
Contains easy_email.module.

Code

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