Question

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!

Was it helpful?

Solution 2

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.

OTHER TIPS

You can use og_get_groups_by_user function 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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top