I have set up a node type that has a mandatory user reference.

I was able to create a view to display the fields on that node (I am using CCK).

I want to filter based on the user that is currently logged in. That is, show the nodes that have the user reference equal to the currently logged in user.

The problem is, it seems that that the view builder expects me to choose from a drop down of users. I want the filter to occur dynamically.

Any experts out there?

Comments

stevenc’s picture

Click the "+" symbol in "Relationships" to add a new one.
Choose "Content: <your user field's name>"
Click "Require" and then "Update"

You've just added a new Relationship.

Now, add a new Filter.
Choose "User: Current"
The next screen now shows a "Relationship" drop-down box. Choose the one you created above and and click "Yes" for "Is the logged in user" and click "update"

Your view will now filter based on the current user.

---------------------------------
Steven Wright

Slalom

scotthoff’s picture

I'm trying to get this to work. I put in some time but have not had success yet. Thanks for the help. I will keep you posted.

muximus’s picture

Had the same problem. @stevenc Your solution worked. Legendary.

scotthoff’s picture

I'm sorry I never replied pointing out that your response was helpful.

I wish you my belated thanks.

stevenc’s picture

Glad it worked out! =)

---------------------------------
Steven Wright

Slalom

ihsanullahkhan’s picture

Thank you very much stevenc. I was searching for 2 days and at last with your guidance I solved this issue.

sheba’s picture

Worked for me. Thanks a lot.

brigitte’s picture

Worked for me by adding "Argument", not "Filter".

Thanks a lot.

sacha05’s picture

Thanks so much :)

perumal.karthi’s picture

Thanks a lot stevenc.

tej28’s picture

After 7 years i used same technique and it is working for me also.

Thanks a lot Steven !!!!!

praveenmoses61’s picture

@stevenc  thanks

mpopova’s picture

Thank you, Steven! It works perfectly!

john.p.baldwin.jr’s picture

Just a note that I applied this basic technique to Drupal 8 successfully. Thanks.

sobi3ch’s picture

@stevenc solution are awesome!