0
votes

I have a View in Drupal (6) which I'm using to build a page for viewing the contents of a node.
A set of n other nodes (of a different type) have content that is related/applicable to this node, and I would like to take their data and print it out in the view too.

I could easily get these nodes programmatically via load_node() so long as I have the current NID accessible. I tried this first - using a Global: Virtual Formatted Field in my view. Unfortunately - the variables that are meant to be accessible within this field are all empty. I don't know why this is - as it's the last field in my view, but the result is I can't do anything with it.

I have also tried experimenting with view relationships, but I'm quite new to that and I'm not even sure it's possible to do what I'm trying to using it.

Does anyone have any idea on how I could achieve this?

Thanks

2
Do you use node reference cck field ?soju
No - I don't, but I could add it in. Would this be able to refer to n nodes?jmillar
Yes, this would be more easy since have a reference to the connected node(s).DrColossos

2 Answers

0
votes

I found this tutorial helpful for learning about relationships and I could achieve something similar to what you are trying.

0
votes

Assume u have 2 content type X and Y. You have a node reference of Y in X. Now you are creating a view of X and want to load information of Y into the X view. So you can use relationships in views. 1 - Create a filter of node type X. 2 - In the relationship select the node reference field to Y present in X. 3 - Now in the fields you can select both X and Y fields. But if you select Y fields there is a select in that field about relationship like (is relationship required) here you can select the relationship created in step 2.