2

I have added a group reference field to basic pages. That is every book page belongs to an OG group. When displaying a basic page, I want to display the list of admin members of the OG group in a block.

So, I have a view in a block with the following :

In contextual filters

Content: Nid

In Relationships

OG membership: OG membership from Node
(OG membership from node) OG membership: Group Node from OG membership
(Group node from OG membership) OG membership: OG membership from Node group
(OG membership from node group) OG membership: User from OG membership

In fields

(user from OG membership) User: Name (User name)

This view display all the users of the group associated to the current basic page. Now, how can I filter theses users to only keep the ones which have an "administer member" role ?

Any help would be greatly appreciated.

  • what is it mean "empty roles"? – Jack-PL Aug 16 '13 at 21:22
  • I have changed the description to make it clearer. I removed the empty roles description as it is not important. Empty roles means when you print it, it is null. – Ben Aug 16 '13 at 22:14
3

I found the solution by doing the following

In Relationships

OG membership: OG membership from Node
(OG membership from node) OG membership: Group Node from OG membership
(Group node from OG membership) OG membership: OG membership from Node group
(OG membership from node group) OG membership: User from OG membership
(OG membership from node group) OG membership: OG Roles from membership

In filters

(OG Roles from OG membership) OG user roles: Role Name (= administer member)

The idea was to select the roles from the OG membership of the Group.

1

Create new block (showing users) with these settings:

Fields:

User: Name

Filter criteria:

User: Roles (= administer member)

Relationships:

User: Content authored

contextual filters:

(nodes) Content: [your book reference field]

provide default value -> Content ID from URL

Other:

Query settings -> tick: Distinct, Pure distinct.

  • I don't think this will work since you are not using any OG information. But thanks. – Ben Aug 17 '13 at 10:16
  • Please try, it's only two minutes of work. Please comment results. – Jack-PL Aug 17 '13 at 10:25
  • I can try but the problem is that I need to filter on OG roles. For example, I have a role called "singer". I cannot do that with this solution. I said "administer member" in my problem just for example. – Ben Aug 17 '13 at 10:28
  • not sure, but maybe you're right. Your problem has been solved, so nevermind. – Jack-PL Aug 17 '13 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.