You are here

function opigno_module_theme_suggestions_opigno_activity in Opigno module 3.x

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

Implements hook_theme_suggestions_HOOK().

File

./opigno_module.module, line 168
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;
}