I have node relationships that I only want to define once.

For example : In a "painting" use node reference field to link to an "exhibition" where the painting appears.

In the "exhibition" - use nodereferrer to display the paintings which are linked to this exhibition.
http://drupal.org/project/nodereferrer

I followed any instructions I could find- added the read-only node-referrer field to the content type... BUT, how can i make it display?

How can I get the info to appear in a template?

I want to get the "painting" title, and then pull an image from the painting's CCK image field- and have this display on the exhibition info page.

Anyone? anyone? ;)

Comments

heather’s picture

i didn't need the node referrer module at all for my needs.

insert views works:
http://drupal.org/node/48816

in my model - make a view of paintings- using the argument - which 'exhibit' are they linking to.

Set up node argument:

$args[0] = arg(1); 
return $args;

Then add this to the node template (in my case the node-exhibit.tpl.php )

<?php
//load the view by name
$view = views_get_view('linked_images');
//output the top three items in the view with the node title as an argument
print views_build_view('page', $view, array(arg(1)), false, 3);
?>
leramulina’s picture

I have the same problem with my site.

I have movie node (with node referrers)
And I have movie shows node (with node reference)

And I need to print the views table of shows to the movie node.
And would like to print some fields related to the move (year of release, director) in the movie show node.

How can I do it?

heather’s picture

did you try the insert view module? or possibly viewfield?

i linked above and put in an example. it turns out, i didn't need the node referrers module. just node reference and then "insert view"

you're basically creating a view which will list the information you require, based on whatever argument you're sending. you know how there's block or page view? well, you're just inserting that view *into* a node template, and passing an argument... "show me info which is linked to this movie"

i'd guess then, that year of release & director info are just normal fields for the movie node, is that correct?

so in your movie node template, print out your movie info, then insert the view...

but maybe i'm misunderstanding you... hmm..

matherion’s picture

You could check http://drupal.org/node/259837 . . .
Good luck!