1

My site allows users to create content and share them with their friends. The relationships are created using UR module. The content type itself has a "Share:",a User Reference field, where the user can select multiple users, from their list of friends. Then there is a view, in which users can see the content created by others and shared with them. The problem is that, well, they cant see it, i cant get my head around the filter. What would be the easiest way to filter this? I've come up with this: if the currently logged in users name is in the contents share field, the data is shown. How to implement this in the view? Any help would be greatly appreciated!

1 Answer 1

0

You want a Relationship on your View.

If you're displaying nodes, add a Relationship on the User Reference field that your node has. Then add a Filter for User = Current User, using the relationship you just created.

3
  • Do you mean adding the "User: Representative node" relationship? If so, i receive an error: An AJAX HTTP error occurred. HTTP Result Code: 500. ResponseText: PDOException, site\wwwroot\sites\all\modules\views\modules\user\views_handler_argument_user_uid.inc). Commented Feb 18, 2013 at 9:26
  • No, it should be called something like, " Entity Reference: Referenced Entity A bridge to the User entity that is referenced via field_user" (If you are using Entity References)
    – beth
    Commented Feb 18, 2013 at 15:11
  • Thank you so much! Worked like a charm with the Entity reference :) Due to my rep i can' vote you up :| Commented Feb 19, 2013 at 9:10

Your Answer

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

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