The Profile2 module integrates with Views to allow listing of users with their profile information.

While you can create views directly using the a Profiles type view, most views will start with a User type view. To add Profile2 fields to a User view, you need to add a relationship for User: Profile.

If you want to add fields from more than one profile type to a User view then each profile type will require its own relationship in the view. For each profile type you want to include, create a relationship and only check the box for the relevant profile type. Note: If you just use a single relationship and check boxes for all the profile types then you are unlikely to get the result you want. In this case, fields from different profile types will be on separate lines in the view.

View with multiple profile relationships

AttachmentSize
profile2_view.png55.51 KB

Comments

DarkteK’s picture

I get this tutorial, but didn't work for me, I don't even see "Custom Profile", so I give you here another method (Taken from user: FAAREIA):

If you want to show up the content the users upload, or something with his/her profile, you must add a relationship on your view.
Relationship >>> Content >>> Autor (from a content view)
Relationship >>> User >>> Profile (from a user view)
Relationship >>> User >>> Content Authored (from a user view)

Then go to fields and new items will be in the list.

I hope this works for you too

dunbi07’s picture

I think the "Custom Profile" is the individual name that was given to the relationship.

This post descripes a pretty good solution on how to deal with multiple profiles: https://www.drupal.org/node/1780466

amh5514’s picture

This solution worked perfectly for me. The title "Custom Profile" is for this example only. In your view, you'll see "User: Profile" twice. I was able to give each relationship a custom title like "Profile: Membership" and "Profile: School" by editing the relationship, clicking MORE and providing my new title.

MichaelWimpey’s picture

I have Profiles2 and Views working nicely together to display a directory of registered users. However i don't want to display profiles of Users who have created an account, but have not yet received Administrator approval.

Currently the view displays all profiles, including those that are blocked. Any ideas?

Fool2’s picture

You probably found the solution to this, but I'm going to answer anyway

Once you've created the relationship, you can add filters and reference that relationship. So you can filter by user=active, etc.