I'm having difficulty getting my head round using the node reference field and views

What I want is to have a magazine contents page for a magazine issue with the contents displayed underneath it.

So far, I have a content type 'Issue' and content type 'Magazine article' and the magazine article has a node reference content field allowing the relevant Issue node to be selected.

But I am stuck on having the contents displayed when ever the Issue node is displayed.
Any advice on this?

I think it might be a views query but how do I have that as part of the Issue content type?

I asked a while back on this forum posting
http://drupal.org/node/191608#comment-776936

but I don't understand what is meant by theming the node-CONTENT-TYPE.tpl.php in the answer
Isn't there another way of doing it with just views query attached to the Issue content type?

Comments

xmacinfo’s picture

Please look over there for some ideas:

http://www.devlounge.net/publishing/how-to-make-a-magazine-style-homepag...

Dustin Boston plans to write a part 2 later.

azoho’s picture

Thanks very much for the tip xmacinfo, looks useful, but it's not really what I'm after right now.
Basically this is for a website for a magazine published monthly and I want to organise the content around each issue.

I want to have it so that when a user clicks on the title or cover of an issue, that it displays a page with the issue node plus the related issue contents listed underneath. So it's a contents page of the issue

nevets’s picture

Another approach is simply to use the Viewfield module.

Make a view that lists nodes, add an argument on the node reference field in the article content type and filter the view on node type so it only shows articles.

Now add a view field to you issue content type, restrict the view type to the one you just made and specify "[nid]" as the argument (you will need the token module installed).

By giving the viewfield a weight greater than zero it will appear after the body of the issue.

azoho’s picture

That's it! Thanks very much nevets it works great. I don't quite get how it works but it works. The [nid] means the view is filtered by current originating node id?

nevets’s picture

The argument you added to view (the node reference field from the article) does the actual filtering, the [nid] provides the value to filter by which in this content is the current node being viewed (the issue content).

baxang’s picture

That really helps me! Thanks a lot :)