Reputation:
I want show in profile page the lists of organic groups that current user is a member.
By default if i call <?php print render($user_profile); ?>
on my result i have one field with the list of my groups membership.
But I can not intercept the function or variable that generates this result.
How i can obtain this with drupal 7? thanks in advance!
Upvotes: 0
Views: 2889
Reputation: 8929
You can use og_get_groups_by_user()
to get group of current user.
$groups = og_get_groups_by_user($account);
This will return group IDs of all the groups this user is an approved member of.
Upvotes: 5
Reputation:
I found the direct access for this
<?php print render ($user_profile['og_user_node']); ?>
Or we can also create a simple view block for profile page..the og module already provides these views by default.
Upvotes: 1