You are here

function hook_social_group_overview_route_alter in Open Social 10.1.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  2. 8.2 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  3. 8.3 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  4. 8.4 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  5. 8.5 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  6. 8.6 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  7. 8.7 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  8. 8.8 modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  9. 10.3.x modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  10. 10.0.x modules/social_features/social_group/social_group.api.php \hook_social_group_overview_route_alter()
  11. 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 97
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(),
      ],
    ];
  }
}