In my theme I had the following:

foreach ($node->og_groups_both as $gid => $gtitle) {
$group_links[] = l($gtitle, 'node/' . $gid);
}

but it doesnt work in preview mode for a content type. Is this a bug, or should I be getting the group names in a different way ?

Comments

pheraph’s picture

Same problem here.

exobuzz’s picture

$node->og_groups is available on preview, so with an additional lookup we can get the group name.
this works for me

  $group_links = array();
  foreach ($node->og_groups as $gid) {
    $gnode = node_load($gid);
    $group_links[] = l($gnode->title, 'node/' . $gid);
  }
gawas.sachin’s picture

this worked for me