You are here

function redhen_contact_theme_suggestions_redhen_contact in RedHen CRM 8

Implements hook_theme_suggestions_HOOK().

File

modules/redhen_contact/redhen_contact.module, line 63
Contains redhen_contact.module..

Code

function redhen_contact_theme_suggestions_redhen_contact(array $variables) {
  $suggestions = [];
  $contact = $variables['elements']['#redhen_contact'];
  $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
  $suggestions[] = 'redhen_contact__' . $sanitized_view_mode;
  $suggestions[] = 'redhen_contact__' . $contact
    ->getType();
  $suggestions[] = 'redhen_contact__' . $contact
    ->getType() . '__' . $sanitized_view_mode;
  $suggestions[] = 'redhen_contact__' . $contact
    ->id();
  $suggestions[] = 'redhen_contact__' . $contact
    ->id() . '__' . $sanitized_view_mode;
  return $suggestions;
}