In Drupal I have 3 content types (A, B, C) see link. A and C contain a node reference to B.
Now I have a view which queries fields from A from an argument. I want to also show fields from C trough the relationschip with B, so:
A has a nodereference of ID:1
B has a Node ID:1
I want to show fields from C where nodereference of ID is also 1. How is this possible? I can't figure out the mapping.
Can someone help me out please?
Currently you can easily go from A to B via the Node Reference but since the link is from C to B you cannot get the link to C -- this is the current problem.
In short, you can solve the problem by using the module Node Referrer (see http://drupal.org/node/431308 for what it does). Essentially it creates a read only field that tells you all the nodes pointing from C to B (i.e. a sort of reverse node reference is created for each node reference).
So lets say we have the following Node Reference fields
a_to_b_link
c_to_b_link
c_to_b_link
Creating the corresponding view is a little bit more involved.
Node: Type =
A
a_to_b_link
. Make sure the you tick the checkbox
Require this relationship
Node:
Referrers
. Also make sure in the settings for the relationship you should
choose the a_to_b_link
in the Relationship
drop down. In other words you are making a relationship that uses a pre-existing relationship (similar in concept to a pointer to a pointer in C++) Make sure the you tick the checkbox Require this relationship
. This relationship by default is named Referencing Nodes
by Drupal.Referencing Nodes