I want to add a link to the group's rss feed (/node/nid/rss.xml) to the group details block. The readme file directed me to this code in the og.module file:

// Modify these links by reference. If you want control of the whole block, see og_block_details().
drupal_alter('og_links', $links);

So I know I have to do something here. But I don't know what to do. Couls someone explain this in more detail.

Thank you.

Comments

moshe weitzman’s picture

Status: Active » Fixed

function [yourmodulename]_og_links_alter(&$links) {
// change $links as desired.
}

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

attheshow’s picture

Status: Closed (fixed) » Active

I had the same issue here. Moshe's suggestion worked for me in D5 version of OG, but not D6. I had to patch my OG module file (line 2375 of current HEAD version) to:

// Modify these links by reference. If you want control of the whole block, see og_block_details().
foreach (module_implements('og_link_alter') AS $module) {
$function = $module .'_og_link_alter';
$function($links, $node);
}

(back to the way it was in D5 version of OG.)

moshe weitzman’s picture

Status: Active » Closed (works as designed)

The mechanism is slightly different in 6. look for drupal_alter() in the source code.

kirikintha’s picture

Is this for 5.10?

function [your_module_name]_og_link_alter(&$links) { (not og_links_alter)
//your links
}

I am trying to take away links and put in new ones, but no matter what I do to the the array, the same links populate the same in the block

-Thanks for the point in the right direction!