I want to show a block on the groups page that lists members with a particular OG User Role, that is a, role appearing in that group. I have a role called "posting member" that gets manually added to users in a group. Rather than showing a block with all members, I want to show one block for "Posting Members" (those members with the role "posting member" within that group), and i want to show another block called "Viewing Members" (those members without the role "posting member" within that group).
I have the roles assigned properly to the users but i am having trouble getting views to display these properly. While trying different settings I'll either have members who have that role listed more than once ("Reduce duplicates" checkbox does not seem to help), or users with the "posting member" role assigned in one single group will get listed as Posting Members in every group they're in.
Perhaps i'm not setting up the relationship right--i'm not sure which filters should use the regular OG Member relationship and which should use the OGUR Member relationship.
I am currently using version 6.x-1.4 with the patch from http://drupal.org/node/406554.
I can test with the dev version or with 1.5 if it's coming out tonight.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ogur_members_list.txt | 6.21 KB | somebodysysop |
Comments
Comment #1
dtarc commentedComment #2
somebodysysop commentedAttached is an exported view named "ogur_members". It is a page view with exposed filters which does what I think you want to do: Display members with a particular role in a group. No duplicates, and only the roles the user has in the current group.
It sounds like what you are missing is the group argument. But, hard to say.
Use the .dev release which should have a date of today or yesterday (depending on your time zone).
Import the view, look at how it's configured, and modify it as needed to create a block display you are looking for.
Let us know if it works for you.
Comment #3
dtarc commentedHi,
Thanks for the quick response and the very useful module.
This was what i was looking for--but i don't think it works as expected. Here's what i did:
Using:
Drupal 6.9
Organic groups 6.x-1.1
OG User Roles 6.x-1.x-dev (2009-Mar-18)
Views 6.x-2.3
I know that i am a version back on core and i really should be doing the test with 6.10--but it's doubtful that this would make a difference here. I'll rerun this test with 6.10 tomorrow to make sure.
I imported your view, as is, and made no changes.
Here are the conditions that i then set up:
2 groups with user 1, user 2, user 3 as members.
In the first group, user 1 is given the targeted role.
In the second group, user 2 is given the targeted role.
There are no other groups in which user 3 is a member and assigned the targeted role.
On the view page for group #1, when filtering by the targeted role, user 1 and user 2 BOTH show up. However in the role column, only user 1 has the targeted role displayed.
Viewing the view page for group #2, when filtering by the targeted role, again user 1 and user 2 both show up, with the targeted role listed in the role column for user 2 and the column is empty for user 1.
So the field handler is working properly, only displaying roles within that groups context. However, the filter handler is not working properly because it's not limiting the filtering to users with the targeted role within that group context. Rather, any users who are a member of the group who have the targeted role within any group context are listed.
I can test this with core 6.10 tomorrow, but, as i said, doubtful that this will make a difference. Let me know if i can provide you with any further details.
Comment #4
somebodysysop commentedYes, you are right. The filter is not correct. Problem is, right now, I don't know how to write the appropriate filter in Views 2. If someone else does, please feel free to contribute!
Comment #5
dtarc commentedThere is a similar issue in the OG Titles queue -- the group context is not being taken into account in the filter handler.
#405272: Titles are not unique 'per group'
I'm not too savvy with views 2 handlers myself but i'll be keeping an eye on both of these issues. If there's a solution provided for one of them then i could write a patch for the other.
Comment #6
somebodysysop commentedCreated a new filter:
OGUR Groups: OGUR: Roles in current group
Add this filter to your view, select "Do not use a relationship" for Relationship. I've tested t his and it appears to do the job: Makes sure that any roles selected in your exposed filter for a group are for restricted to just that group.
Submitted code changes to CVS. Should be available in .dev release in about 12 hours.
Please test and report back if it works for you. Thanks.
FYI:
This is how I solved it: http://drupal.org/node/408122
Comment #7
katiusha commentedI've edited the default og_members and og_members_faces views and I've added the following filters:
OGUR Groups: User Roles contributor (contributor is one of the possible roles on my Drupal installation)
OGUR Groups: Roles in current groups
And it worked! On the faces and list tabs I can see now only the contributors.
Thanks!
Comment #8
somebodysysop commentedComment #10
mxtIs this filter available in 6.x-4.x-dev ?
I need this feature to retrieve all users with a specific OGUR role (ATTENTION: not core roles) starting from a content node ID belonging to a group.
Thank you!
MXT