Closed (duplicate)
Project:
User Relationships
Version:
6.x-1.0-beta9
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2009 at 01:02 UTC
Updated:
1 Aug 2010 at 15:09 UTC
I'm trying to display a page that shows all content created by the logged in user's relations.
I cannot find a way to filter a set of nodes based on the fact that the Requester is the currently logged in user. If I add "User relationships: Requester user" my Views filters, I have to type in a user name. I can't selected that the user be the currently logged in user. This is a simple and important task, and I'm surprised it 1) isn't included or 2) is well hidden.
Does anyone have any input on how to do this?
Comments
Comment #1
gallamine commentedbump.
Any thoughts? How do I select relationships in Views based on the relationship to the currently logged in user?
Comment #2
yoeld commentedIf I understand you correctly, you should use User: Current (Filter the view to the currently logged in user).
Comment #3
kenorb commentedI've done it by adding Relationships: 'User relationships: Requestee user' and adding Filter: 'User: Current' using user relationship.
Comment #4
apmsooner commentedTry this...
Create view based on type node
1. Add relationships in the relationship section for "requestee user"
2. Add argument in the arguments section for "requestee user", check "provide default argument", user ID from URL, validate as user
3. Add fields in fields section, requestee user > related to requestee user (exclude from display if you want), add other node content fields that you want to display.
4. Add optional filters: Node Type, Published, and relationship status = approved so that you only show content from related users with approved relationship status.
Test out the view by specifying the user ID in the preview field and it should show all nodes submitted by related users to the user in question. I set it up this way with the intention of using the content profile module in conjunction with user relationships so that I could attach a view of the related node types to the user profile so example when viewing user/4 profile in the url, related users for example user/3, user/9, etc... that created content would be displayed. It's confusing as hell but it works and if you are familiar with panels it is a really cool way to create a custom social networking site by adding various views to the user profile template in panels. Another option I guess would be to modify the argument as "user ID from logged in user" but in my case I wanted other users related to my user to be able to view the content as well in which "user ID from url" accomplishes that. Hope that makes a little bit of sense....
Comment #6
cookiesunshinex commentedI got this working as #4 suggested.
I would like to clarify that the argument details listed in #4 were not that clear.
I used the following variables for the Argument:
1) Relationship: Requestee
2) Action to take if not present: Provide Default argument
3) Provide Default Argument options: User ID from Logged in User
4) I left Validator Options: as "Basic Validation" and it seems to work fine.
For Filters:
Node Type = (my node type)
Node Published = Yes
User Current: No
User Relationships: Relationship Status = 1
Comment #7
YK85 commentedThis lists where the current logged in user is the Requestee.
But what about the Requester being the current logged in user?
How can we get a view where the current logged in user is either the Requestee or the Requester?
Thanks!
Comment #8
YK85 commentedclosing and included my comment at #7 in #822508: Improve UR-Views Integration
Comment #9
YK85 commentedthis is now easily possible with #866400: Views filter patch for current user
marking this as duplicate