By lunas on
How does one access the uid on a usernode for use in a views block? I have a block I made in views that appears only on a user's usernode, however I can't make the view work on the usernode because the url resembles node/2606 and 2606 does not relate to the uid. Basically I guess I need a way to translate the usernode ID into the author's UID. Thanks.
Comments
UID in views block on usernode
I'm having trouble with this too.
I want to get the node -> uid so I can add it to the views argument handling code.
I want to use this to display a block of images relating to the author of that node.
Im trying to use.........
Argument type
------------------
User: UID Authored or Commented
Argument code
------------------
$test = $node->uid
$args[0] = $test;
return $args;
But it doesn't work! Please help!!
Thanks
Try this
I finally got it working using this in the argument handling code:
UID in views block, show other images by author argument code
Thanks Lunas I was scratching my head for days on this one!!!!!
It works!!!!!!!!
I also added a bit of extra code to prevent anything happening when you are viewing a page that isn't just a single node.