How can I form a Views query that retrieves all nodes that are referenced by a node in another content type? I have a content type of Artist. I also have a content type of Release. The Artist content type has a node reference field that points to the Release content type. This node reference field allows an Artist to have 1 or more Releases.

I created a view that displays fields from the Artist content type as a page. Let's call this view "Artist Page." Artist Page has a single argument of Node: Title and a path of artist/%. This works really well.

I would like to add another view for a block of Releases belonging to a particular Artist. I hope to display this block in the sidebar for Artist Page.

How can I form a Views query that retrieves all Releases that are referenced by an Artist?

(I am making my first non-trivial Drupal 6 site and I appreciate your patience. I am happy to RTFM but please tell me where to go!)
Ok, So the way to do this is with arguments and relationships.

Normally using the "Provide default argument" option would work but since you're not using the actual "artist" node you can't actually get the node id from the URL.

Also just an FYI, passing the title for a views argument is a bad idea because then the query is doing a lookup based on text instead of a numeric value such as the node id which is better on performance.

But anyways the solution to your problem is add the same argument to your block view as you did to your "artist" page view. This should be the node title argument. Now add a relation to your view. The relationship you want to add is the content: [name of node reference field] relationship.

Now you can add what ever fields to your view that you would want to include from the "release" content type but now you will see you get a relationship option in the field option. When you want to display fields from the "release" content type just be sure to select the [node reference] relationship.

Also we need to do one more thing. Which is getting the proper argument to be picked up by your block view. This is a bit trickier mainly because of what I mention earlier which is that you're passing the node title as an argument. So now you can edit your Node: Title argument and you should see the "option to take if the argument is not present" select the "provide default argument" and select the php code option. In there you want to paste this piece of code.

return arg(1);


Now save your view and place that block on the page and visit the artist/% page and you should now see what ever fields you want to use. This php code is telling your block view to pick up the artist/% argument from the url.

A couple of things to lookout for:


php code in the views is bad, I just mentioned that here as a quick fix to your problem.
When using relationship be sure to select the relationship option only when you want to display a field from the "related" item. In other works if you want to display the title of the related node select node title and be sure the relationship is selected. If you want to display the title of the node being passed in on the argument select node title just don't select any relationship. 


Hope this is helpful, is a long post but relationships can be confusing. 

Hope this helps.