You are here

function heartbeat_theme_suggestions_heartbeat in Heartbeat 8

Implements hook_theme_suggestions_HOOK().

File

./heartbeat.module, line 78
Contains heartbeat.module.

Code

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