function opigno_module_theme_suggestions_opigno_answer in Opigno module 3.x
Same name and namespace in other branches
- 8 opigno_module.module \opigno_module_theme_suggestions_opigno_answer()
Implements hook_theme_suggestions_HOOK().
File
- ./
opigno_module.module, line 184 - Contains opigno_module.module.
Code
function opigno_module_theme_suggestions_opigno_answer(array $variables) {
$suggestions = [];
$entity = $variables['elements']['#opigno_answer'];
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
$suggestions[] = 'opigno_answer__' . $sanitized_view_mode;
$suggestions[] = 'opigno_answer__' . $entity
->bundle();
$suggestions[] = 'opigno_answer__' . $entity
->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'opigno_answer__' . $entity
->id();
$suggestions[] = 'opigno_answer__' . $entity
->id() . '__' . $sanitized_view_mode;
return $suggestions;
}