By calebm12 on
I am trying to figure out how i can edit the group details block in OG. String overrides is not changing any of the text, and not sure where to find the block so that i can edit out some of what it contains. Any useful suggestions would be appreciated.
Comments
_
From the README.txt:
not sure where
not sure where og_block_details is? what file is it located in?
_
I usually check the .module file first-- and yep, it's there. ;-)
How would you go about adding
How would you go about adding classes to each individual link?
I can't seem to output the links individually but rather only as an entire list using:
print $block->content;Was hoping I could do this or something similar in my tpl.
print $links['subscribe']->content;or perhaps override function og_subscribe_link in my helper module so i can add a class attribute...doesnt seem like either option is working for me though
I've been trying to figure
I've been trying to figure out how to modify this block (or create my own) for a while now. I've found several posts that talk about it being possible but nothing concrete. Have you figured this out? Or have you come across any good documentation on this?
a very simple module works for this
This thread explains how to roll your own very simple module for modifying the group details block:
http://lists.drupal.org/pipermail/support/2009-June/012324.html
Though I am not a programmer, I was able to follow the instructions (kindly provided by Hans Rossel) and they worked for me.
Making your own module has the advantage that your customizations won't get overwritten when you upgrade the main OG module.
HTH!
@cygrapher, thanks for the
@cygrapher, thanks for the tip.
I wanted to change the word 'manager' to 'chair'. String overrides wasn't working and i didn't really want to hack the og.module.
This is what i did:
Really, though, text should not be hard-coded. Rather it should either be pulled in from a database or variables should be initialized in a separate include file in a global or static array and accessed through a get_variable function.
what the heck does HTH! mean?
just wondering
_
http://lmgtfy.com/?q=hth+acronym&l=1
thank you for the good info, I used it
I used the following code for the module. I called my module "detail_menu" but you can call yours whatever you wish.
My custom module does three things:
1. removes the "invite" link
2. Adds an "Add participants" link dynamically
3. Adds a "remove participants" link dynamically
I tried this and I'm not
I tried this and I'm not getting the $node->nid values passed at all. Are they for you??
for example the Add Participants link is linking to "/og/users/%252Fgroupadmin"
(252 has nothing to do with the nid, the "%252F" is html encoding...the nid is not being passed at all.)
what am I missing?
I'm missing the same thing
The $node->nid just seems to be ignored when I use it in my custom module.
The links I want to edit just go to baseurl/groups/ instead of baseurl/groups/123 (123 is the $node->nid)
Can anyone help us with this?
UPDATE:
Nevermind this, I fixed it. Forgot to put this line of code in my module:
if (($node = og_get_group_context()) && node_access('view', $node))Now the $node->nid works perfectly.
A mild hack...
Sorry we did not see this sooner, but here's a fairly simple, gulp, hack that works fine for our needs. We needed to get the details module to simply link to the members -- face, list and add -- and most of our users found it very confusing to see much of the other stuff, particularly the repetition of what we already had in navigation for creating content. We really shy away from hacking ANYTHING, but we have a small list of modifications we made on our sites that we consult when we update. Here's how to hide everything but the "83 members" link...
I noted out the necessary lines:
function og_block_details() {
global $user;
// Only display group details if we have a group context.
if (($node = og_get_group_context()) && node_access('view', $node)) {
list($txt, $subscription) = og_subscriber_count_link($node);
if ($subscription == 'active' || user_access('administer nodes')) {
//$links = module_invoke_all('og_create_links', $node);
// We want to open this up for OG_INVITE_ONLY but we need to handle invitation workflow much better. See http://drupal.org/node/170332
if ($node->og_selective < OG_INVITE_ONLY) {
$links['invite'] = l(t('Invite friend'), "og/invite/$node->nid");
}
$links['subscribers'] = $txt;
// $links['manager'] = t('Manager: !name', array('!name' => theme('username', $node)));
geoff gevalt
http://www.youngwritersproject.org
http://www.ywpschools.net
http://geoffreygevalt.com
OG Configurable Details Block
It's obviously been a few years now, but for anyone happening on to this post, you may want to consider the OG Configurable Details Block which allows you to:
Altering Links in the block
Can anyone give an example how I can alter a link please?
(I can hide or create a new one, I can't see how to alter one)
Thanks!
Editing links
My first suggestion would be to edit the name of the content type you created to the text you wish to use in your group. If that doesn't fit your needs you can edit the links with the code below.
Within your created module insert this code to view all links within the details block:
drupal_set_message(''. var_export($links,TRUE) .'');
Once you have found the link you would like to edit you can use the code below to edit the link. Replace 'link_name' with your link and replace 'Replacement Text' with your replacement text:
$links['link_name'] = l(t('Replacement Text'));
If you need to direct the text to a url you will need to insert it into the code:
$links['link_name'] = l(t('Replacement Text'), "node/url/$node->nid" . $group->uid);