Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By rameshbabu.g on
I am using OG7(Organic Groups) module drupal 7 for creating groups..
In that I have added users to particular group and created a role to create content in that group i.e. Group owner
Then I need to show group members list in a individual group.
Please suggest me to display this block.
Comments
Hey Ramesh, did you check the
Hey Ramesh, did you check the Blocks configuration? There should be a "Group members" block. There is also a page listing all members, see for example: http://groups.drupal.org/og/users/223/faces
Given link not working
Thanks for your reply..But the given link displaying no results..It is displaying "Access Denined" message.Can you please tell me any other option to display group members list.
r@mmi
I don't know
I can't see this.
Same problem here
I don't know how to do the same thing. I'm new to Drupal
I'm not sure if you're
I'm not sure if you're running into the same problem that I was, but if your groups have URLs like http://www.yoursite.com/groups/groupname (or just yoursite.com/groupname, for that matter) your problem is that the blocks system can't directly translate your URL alias to the gid (group ID) that it needs for the filter. So here's what I did, hopefully this can help you or someone else with the same problem:
1. Edit the view at /admin/structure/views, click Edit next to the og_members view.
2. Click on (group membership) OG membership: Group gid under Contextual Filters.
3. Under When the filter value is not available check the Provide default value option.
4. Select PHP Code for the type and enter the following for the code:
return arg(1);
5. Substitute 1 for whichever argument contains the group name which can be translated to gid -- in my case, my groups are all aliased as /group/groupname, so arg(0) would be group, arg(1) would be groupname which is what I want.
6. Save, and test.
If you don't have PHP Code as an option in step #4 ensure that the filter is enabled both in Modules and in Configuration/Text Formats.
For steps 3 and 4, try
For steps 3 and 4, try "Current OG group from context" instead. That works great for me.
Right on -- works great and
Right on -- works great and seems less ghetto and hacky than my solution!
That worked!
Great! That worked! Thank you so much Saoirse1916 and illepic. I spent way too much time trying to figure that out on my own.
I then had to do the same thing with the content block.
Thank u
worked like charm... thanks guys.... :D
Get Inspiration to after reading
Thanks a lot Energyblazar .
Dreams are come true.
Although this is not a relevant topic under this threads.
BTW, When i am going to access the link, every time i see the message" Access is denied"
I want to get rid off it.
Great
Thank you very much
one more solution
this is only works for OG group nodes not working at OG content pages.
one working and tested solution is below
1. Edit the view at /admin/structure/views, click Edit next to the og_members view.
2. add a Relationships OG membership: OG membership from User
3. Click on (group membership) OG membership: Group gid under Contextual Filters. and use step 2 Relationships
4. Under When the filter value is not available check the Provide default value option.
5. Select PHP Code for the type and enter the following for the code:
6. Save, and test.
solution 2
In views OG create a view by name " OG members (User)"
1. Just clone this block and set name etc.
2. click Contextual Filters which already add and change value Under When the filter value is not available
Select PHP Code for the type and enter the following for the code
3. save
and its done
code.rider
Group members list from User Context
I'm trying to create/alter a view that will provide the names and contact info of members of groups that the current user belongs to. Is there anyway to get the group list to work with the user context instead of the node/group context?
Thanks, works great
"For steps 3 and 4, try "Current OG group from context" instead. That works great for me."
Special thanks to illepic.
I completely forgot to add that default setup and was going nuts trying to get this view to function. Thanks for taking the time to post, saved me a ton of hassle!
Slight modification
This seems to have changed slightly since the most recent comment.
"Current OG group from context" was not available for me, so I used "Content ID from URL" under the "Provide Default Argument" option and that worked for me. So the new steps that worked for me are as follows:
I hope this can help someone, I spent a good bit of time working this out.
Need to enable the sub-module
if "Current OG group from context" is not available for you - enable the "Organic groups context" sub-module.
Should then be able to choose "Current OG group from context" in the contextual filter, as mentioned above.
This worked for me today anyway, hope it helps you :)
Page Manager
Use page manager with content ID as the context of the inserted view!