Mohsen
Mohsen

Reputation: 11

how to make a filter for View which find nodes that have a user_reference field referring current user?

I have a content type, named "Task". It has a cck user reference field named "assigned_user". I want to filter Tasks, which their assigned_user is current user. how can I use "Token Filter" for this for my view? I installed this module but I didn't find anywhere for inserting tokens in view filter. Does exist any better way?

Upvotes: 1

Views: 1483

Answers (1)

Sid Kshatriya
Sid Kshatriya

Reputation: 5015

  1. Create a View of type Nodes
  2. Add a filter of Node: Type = Task in your view
  3. Add another filter from the drop down group Content. Now choose Content: assigned_user. Now choose the operator is not empty
  4. Add an argument from the drop down group Content named Content: assigned_user. Now in the argument settings for Content: assigned_user under action to take if argument is not provided choose provide default argument. Now choose User ID from logged in user
  5. Add the fields you want in your view e.g. node title etc
  6. You're done!

Upvotes: 1

Related Questions