function flag_lists_theme_suggestions_flagging_collection in Flag Lists 4.0.x
Same name and namespace in other branches
- 8 flag_lists.module \flag_lists_theme_suggestions_flagging_collection()
Implements hook_theme_suggestions_HOOK().
File
- ./
flag_lists.module, line 125 - Contains flag_lists.module.
Code
function flag_lists_theme_suggestions_flagging_collection(array $variables) {
// Prepare for different presentations of different flagging collections.
$suggestions = [];
$entity = $variables['elements']['#flagging_collection'];
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
$suggestions[] = 'flagging_collection__' . $sanitized_view_mode;
$suggestions[] = 'flagging_collection__' . $entity
->bundle();
$suggestions[] = 'flagging_collection__' . $entity
->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'flagging_collection__' . $entity
->id();
$suggestions[] = 'flagging_collection__' . $entity
->id() . '__' . $sanitized_view_mode;
return $suggestions;
}