You are here

function opigno_module_theme_suggestions_opigno_activity in Opigno module 8

Same name and namespace in other branches
  1. 3.x opigno_module.module \opigno_module_theme_suggestions_opigno_activity()

Implements hook_theme_suggestions_HOOK().

File

./opigno_module.module, line 169
Contains opigno_module.module.

Code

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