function hook_social_group_overview_route_alter in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 8.2 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 8.3 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 8.4 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 8.5 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 8.6 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 8.7 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 10.3.x modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 10.0.x modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 10.1.x modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
- 10.2.x modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
Provide a method to alter default group overview route.
Parameters
array $route: An array with route name and parameters.
\Drupal\group\Entity\GroupInterface $group: Current group entity.
1 invocation of hook_social_group_overview_route_alter()
- _social_group_get_overview_route in modules/
social_features/ social_group/ social_group.module - Get group overview route.
File
- modules/
social_features/ social_group/ social_group.api.php, line 85 - Hooks provided by the Social Group module.
Code
function hook_social_group_overview_route_alter(array &$route, GroupInterface $group) {
if ($group
->bundle() === 'challenge') {
$route = [
'name' => 'view.challenges_user.page',
'parameters' => [
'user' => \Drupal::currentUser()
->id(),
],
];
}
}