0

I created a Drupal 7 view that displays users profile 2 fields. However if i disable the user their fields are still visible in the view. Is there a way i can filter users by their status of blocked or active?

enter image description here

  • Add filter for status and set it as active/blocked which ever you need to display. – Ajay Reddy Oct 26 '17 at 12:54
  • searching for status in filter criteria comes up empty. – blu Oct 26 '17 at 12:56
  • 1
    If it is a profile2 based View, then you have to create a relationship to the User. This should then create new filtering options based on that relationship. – Kevin Oct 26 '17 at 13:02
  • i'm not entirely certain how thats done. all the way on the right under advanced and relationships i made one from indexed user to Main profile profile but i don't see any new filtering option. – blu Oct 26 '17 at 13:28
  • Indexed user? Is this Search API? – Kevin Oct 26 '17 at 13:50
1

The steps are:

View name: test Show: Profiles of type: All

Page title: test Display format: table.

click "Continue & edit" button.

In the "FIELDS"

add the "Profile: User uid" field and add all fields related to the profile module.

Then add a relation in the path: Advanced-> RELATIONSHIPS

select the "Profile: User uid" field.

mark the checkbox "Require this relationship".

Click "apply (all displays)" button.

Then add a filter to "FILTER CRITERIA".

Seach and check the field: "User: Active"

We checked the checkbox: "Expose this filter to visitors, to allow them to change it"

Click "apply (all displays)" button.

Click "save" button.

  • this works if i create a new view but not the existing view. Profile: user uid doesnt appear – blu Oct 26 '17 at 15:32
  • In your view, follow these steps from: Then add a relation in the path: Advanced-> RELATIONSHIPS – JHONATAN DAVID FERNANDEZ ROSA Oct 26 '17 at 17:09
  • under the advanced-> RELATIONSHIPS there is no Profile: User uid or anything with uid in it's name – blu Oct 26 '17 at 18:12

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.