0

In my site each 'User' as a profile (created using Profile 2). One of the fields in the profile is a 'Select list field' that allows the user to choose his/her State of origin.

Please how can I create a View which displays to each "currently logged in user", the people who come from his/her State.

I have tried the following but it returned empty.

  1. I created a User view.

  2. I added some fields

  3. I added the following relationship- "User:Profile"

  4. I added the contextual filter on "(Profile) Profile:State" to provide default value from "User ID from logged in user" if filter value is not in the URL.

  5. I added the contextual filter on "User:uid" to provide default value from "User ID from logged in user" if filter value is not in the URL.

0

You should set the contextual filter to have a default value provided by the UID. Since you're trying to only display the list of users where they have the state in common, you'll need to set the default for the profile:state to be provided by the UID.

| improve this answer | |
  • I am not sure I understand. I believe that is what I already did in "4" above and it returned empty. – seyi Nov 2 '14 at 5:37
  • You probably need to load another relationship to either the profile2 content associated with the UID or the account. Relationships stack. You'll have to play around with it a bit to find the right combination. I'll see if I can reproduce something similar and update my post. – Neal Garrett Nov 2 '14 at 12:45

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.