How to get a custom group field with Views?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
jlmainguy's picture

Hi,

I was looking for a way to retrieve a custom field from a group in a view?

For example, I have my Group content type in which I added a custom field (say the «Group Color» field).

Then, I wanted to build a view in which I could show the current node's group «Group Color» field. I was able to retrieve the current node's group ID, but not the custom field.

I built the view showing any type of node and used the OG Groups relationships to ge the current node's group ID.

Anybody has an Idea on how to do this?

Thank you,

Jean-Louis

Comments

What version

jasonawant's picture

Hi,
What version are you using? Jason.

Version

jlmainguy's picture

Hi,

I'm using :

  • Drupal 7.12
  • Organic Groups 7.x-1.3
  • Views 7.x-3.1

Thank you,

Jean-Louis

Add field using group relationship

jasonawant's picture

Hi,

I'm using OG 7.x-2.x, which I think is different than the version you are using.

However, I think you follow these steps.

Find the view organic group provides to display a users groups. I think it displays the Title using the organic group relationship.

Clone this view. Then, in this new view, I add the color field and use the same relationship.

Let me know if that works. Jason.

Organic groups

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: