By uwe

2011-11-10 03:31:25 8 Comments

I have a view showing a list of nodes of type group. How do I set it up to show the count of members that belong to each group?


@uwe 2011-11-10 18:31:16

I finally figured it out:

enter image description here (enlarge image)

The steps are:

  • create a view for "content" type "group". Use "fields" and show "content:title", that's the name of your group
  • add relationship "Group: Node group" (required), then "(group) Organic groups group: OG membership" (required).
  • add filter "(OG membership) OG membership: Entity_type " and set to "is equal" to "user"
  • "use aggregation"
  • add field "(OG membership) OG membership: Entity id" and use "count distinct" option. That's your count of members.

If you want the count of nodes that are "linked" to a group you would just change the filter from "user" to "node".

@Reg Gordon 2013-04-14 07:58:53

a brilliant MotoTibe thanks. Ill go give it a go and thanks for the reply

@Reg Gordon 2013-04-14 08:09:42

as i feared things seemed to have changed in 7.2. No longer have the Group: Node Group relationship. OG membership: Group Node from OG membership could be what it is now. ill try that

@Reg Gordon 2013-04-14 08:11:23

but we also have OG membership: Group User from OG membership. Maybe it could be OG membership: OG membership from Node group though

@Reg Gordon 2013-04-14 08:12:21

or Group membership (og_user_node) :(

@asiby 2013-10-02 14:47:34

I have discovered something that might help. In the header section of the view, click on "add" and choose "OG membership: Group membership overview". That single entry will add something that looks like the following:

Group overview

 - Group manager: admin
 - Total members: 4
 - Total content: 0

I desperately need those to be individually available in the "fields" section of the view where if can be displayed with more flexibility ... and per row.

I will dig into the code and add those views fields. Hopefully things go well. If so, I will post the code back here, and a patch on the OG project page, or an custom module.

I am starting to think that Drupal module builders seriously need to organize focus groups regarding the usability and the necessity of some new features. The OG seems so disconnected from the end users needs that I am starting to have serious doubt about using it. Unfortunately, there is no alternative that I know of.

(Note from different user: Had this exact same problem, and comment #62 on this issue worked for me:

Related Questions

Sponsored Content

1 Answered Questions

How to switch OG group members in bulk to another group

  • 2016-05-05 03:20:32
  • user14666
  • 29 View
  • 0 Score
  • 1 Answer
  • Tags:   organic-groups

1 Answered Questions

In views, show the number of users who have subscribed to the organic group

1 Answered Questions

1 Answered Questions

[SOLVED] How to show the number og members views members views

2 Answered Questions

Sponsored Content