function social_group_preprocess_group__hero in Open Social 8
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 8.2 modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 8.3 modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 8.4 modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 8.5 modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 8.6 modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 8.7 modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 8.8 modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 10.3.x modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 10.0.x modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 10.1.x modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
- 10.2.x modules/social_features/social_group/social_group.module \social_group_preprocess_group__hero()
Implements hook_preprocess_HOOK().
File
- modules/
social_features/ social_group/ social_group.module, line 295 - The Social group module.
Code
function social_group_preprocess_group__hero(array &$variables) {
/** @var \Drupal\group\Entity\GroupInterface $group */
$group = $variables['group'];
$account = \Drupal::currentUser();
if ($group
->bundle() == 'public_group' && $account
->isAnonymous()) {
$variables['group_operations_url'] = Url::fromRoute('user.register', [], [
'query' => [
'destination' => Url::fromRoute('entity.group.join', [
'group' => $group
->id(),
])
->toString(),
],
])
->toString();
}
}