more control over "group details" block
| Project: | Organic groups |
| Version: | 5.x-5.4 |
| Component: | og.module |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
Hi,
One feature of og module that I'm looking for is to give an administrator more control over "group details" menu. Now, it includes all "create !type" links for all node types which participate in the Audience targeting system. It is becoming a problem when the number of such node types is large so it would be good if admin could control which links are printed. Displaying the search field could be also configurable.
First, please let me know if a solution to my problem already exists.
If it doesn't then I'd like to know if og core team is interested in implementing such a feature, is willing to do it or at least if would accept a patch or if it should go to separate module.
I would appreciate any feedback and please, let me know about possible problems
that such a feature may introduce (if any).
Thanks for a great module, btw!
Cheers,
Zbigniew

#1
with the latest release (see head) you can theme and completely control this block. See the og_block_details().code. If you don't know how to theme a themable code, please look in the handbooks.
See here http://drupal.org/node/230501
#2
#3
Thanks. I didn't know about this solution however, it requires editing the code of the module every time it's updated and/or a new content type is added. I tried to avoid any custom changes of the code but be able to decide which links I wanna see in "group details" block just by going to og module settings.
#4
It does not require changing the code all the time as you suggest. The grop details block has a hook_og_links_alter where you can unset() links or add them or whatever.
#5
Can someone please provide a bit more information on hook_og_links_alter and how to use it? My project also requires reorganisation of the group details block.
Thanks
#6
An example: To change the links in the group details block make a helper module, example.module and put in it:
/**
* Implementation of hook_og_links_alter().
*/
function example_og_links_alter(&$links, $group_node) {
// drupal_set_message(''. var_export($links,TRUE) .'');
// Remove .. members link and change Invite link to Blablabla in group details block.
$links['invite'] = 'Blablabla';
unset ($links['subscribers']);
}
#7
How about theming links in Group Details block?
#8
I don't know a lot about coding, but copy/pasted your code to a created directory 'og_changemenu' , put a .info and .install file into it, and started your code with <?php in a og_changemenu.module file.
It does'nt do anything. Neither an error. Maybe due the 6.x version I used?
Hope you can give a hint, or someone had another solution.
UPDATE:
Is working now for me.
Changed the line:
function example_og_links_alter(&$links, $group_node) {
into:
function name-of-my-module-i-give_og_links_alter(&$links, $group_node) {