2

Using Drupal7 Views 3 and Flag 3, I have been able to display users-profile I have flagged "subscribe" but no luck to display users-profiles that flagged me "subscribe".

Below is what I currently have but the result is still displaying users that the given url has flagged.

I used filter"user ID from url" and for relationships, I used "flags:subscribe(by any user) and checked/unchecked include only flagged content.

Please help. enter image description here

enter image description here

3 Answers 3

1
  1. Create view with type "User"
  2. Add Relationships "Flags: User's flaggings". Choose your flag name and set checkbox "Include only users who have flagged content."
  3. Add Contextual filter "Flags: Entity ID". Choose in the filter settings "Provide default value" -> "User ID from URL"
1
  • under "flags:Entity ID, should I add the basic validation as user and criteria as id and usernames because i have id's as usernames?
    – Yoric
    Jul 10, 2015 at 15:45
0

I assume you named your flag subscribe. Create a view of type USERS, Add the USER as Fields and In the Relationships add

Flags: subscribe (by current user)

Then the users subscribed will be shown. I used this method to follow users like what Instagram does. I mean your configuration should be like this (Instead of Follow select your flag):

enter image description here

2
  • Thanks for your answer but I still get the users flagged by the current user and not the users that has flagged the current user.
    – Yoric
    Jul 10, 2015 at 15:43
  • Take a screnshot if your view and place it in the question
    – M a m a D
    Jul 10, 2015 at 15:52
0

I have cracked it!

  1. First add relationship
    • Flags:User's flaggings
      • Check Include only users who have flagged content.
      • Pick your flag type (in my case "subscribe")
  2. Second add relationship
    • Flags:User
      • relationship remains the same(user flagged content).
  3. Third add Contextual filters
    • Flags:Entity ID
      • relationship remains the same(user flagged content)
      • provide default value (User ID from URL)
      • specify validation criteria (validator-user) in my case i have usernames (Allow both numeric UIDs and string usernames)
  4. Fourth add filter criteria
    • Flags:User uid
      • relationship remains the same(user flagged content).
      • operator(tick "Is not empty (NOT NULL)") do not insert a username.

Save your view. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.