I admit I'm pretty new to this. I'm looking for a way to pass the current user's UID to Views as an argument. I've been using the "me" module to jury-rig this, but it isn't working for a certain function - specifically, I want to pass the current UID as an argument through a nodereference field in a custom content type.

I've searched for some varying bits on the site here, but haven't found anything specific. Is this possible?

I appreciate any advice you folks can throw my way. Thanks!

Comments

merlinofchaos’s picture

Status: Active » Fixed

Under filters, "Node: Author is current user" (I think it's called something like that).

merlinofchaos’s picture

Oh, I didn't read well enough.

Actually, in your case you probably want to use the PHP Argument code block.

In that block, put this:

  global $user;
  return array($user->uid);
phasmaphobic’s picture

Thanks so much! This is exactly what I needed. I'm still wrapping my head around the arguments, but help like this makes it a lot easier. I appreciate it!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

giorgio79’s picture

This was what I was looking for as well.

I wanted to get a view that displays a specific content type generated by the current logged in user...

I have not found the Node: Current logged in user option but will try the snippet...

Will test this now.

Cheers,
G