I want to be able to create a View (using views.module), which will create a Block which contains a listing of other nodes created by the same author as the current node.
I've really struggled, and can't figure out how to do this. I'm afraid I still don't really understand Arguments (do they even apply to Blocks?), and I see that I can create an Argument called "User: UID is author", so I tried to use something under Argument Handling Code which would pass $node->uid as a custom argument, thinking that then it would filter out all the nodes whose author's UID did not match the node's, but I have to admit I'm babbling a little bit.
Can someone please help me to understand how this might be possible? Here's what I currently have under Argument Handling Code:
if($type == 'block' && $args[0] == 'node' && is_numeric($args[1])) {
$node = node_load(array('nid' => $args[1]));
$args[0] = $node->uid;
return $args;
}
A wrinkle here is that my actual URL is a modified path, and doesn't actually contain the nid. Is that the problem? Or does Arguments get it's data from the "real" default Drupal URL instead of the modified path URL?
Thank you!
Comments
Have you had any luck with
Have you had any luck with this? It's driving me loony too.
Not sure it,s possible with
Not sure it,s possible with views, but please if it'spossible could someone take the time to post thesolution here, it would really be a killer snippet to use with views!
could this work?
it's a part of a snippet that's supposed to do the same thing...
Use a custom block instead
I did figure out how to do this, but not with Views, check out this thread:
http://drupal.org/node/109056