Hey,

I'm currently working on a social-site and for the Profile page I would like to include a section like "My groups" so that everyone can see on the profile page which (organic) groups the user belongs too.

I searched the Handbook and Forums but haven't found one so far but couldn't find one.

Does something like this already exist somewhere and I just didn't find it?
Could anyone write it up or give hints how to realize that?

Thank you in advance!

Comments

akaifi’s picture

Here's a good place to start for an answer:

http://drupal.org/node/29445

You will have to alter it to:


  if ($user->og_groups) {
    foreach ($user->og_groups as $key => $val) {
      $links[] = l($val['title'], "node/$key");
    }
    $output = theme('item_list', $links);
  }

  print $output;

Best of luck to you!

Anonymous’s picture

Thank you very much. The code you posted worked great!