function activity_creator_theme_suggestions_activity in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 8 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 8.2 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 8.3 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 8.4 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 8.5 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 8.6 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 8.7 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 8.8 modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 10.3.x modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 10.0.x modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
- 10.2.x modules/custom/activity_creator/activity_creator.module \activity_creator_theme_suggestions_activity()
Implements hook_theme_suggestions_HOOK().
File
- modules/
custom/ activity_creator/ activity_creator.module, line 253 - Activity Creator module file.
Code
function activity_creator_theme_suggestions_activity(array $variables) {
$suggestions = [];
$activity = $variables['elements']['#activity'];
$sanitized_view_mode = str_replace('.', '_', $variables['elements']['#view_mode']);
$suggestions[] = 'activity__' . $sanitized_view_mode;
$suggestions[] = 'activity__' . $activity
->id();
$suggestions[] = 'activity__' . $activity
->id() . '__' . $sanitized_view_mode;
return $suggestions;
}