I have a data model as shown in attachment. My view have “A” as a main content type. Then I created relationship “b” to “B” content type. Works. But I can't figure out how to show fields from “C” content type.

Nothing seems to work, for example chaining relationships. Even if I changed name of node reference field in “C” to something different than “b”. Views seems to join “C” table by node “vid” column instead of node reference field – this can't work because “A” and “C” tables have completely different nodes (vid).

Any help will be appreciated.

CommentFileSizeAuthor
content-types.png5.16 KBmki

Comments

mki’s picture

Status: Active » Fixed

The answer is Reverse Node Reference module. From module description:

Node Reference fields in CCK for Drupal 6 provide relationships to Views that allow you to access fields from the referred nodes of a particular node reference field. These kind of relationships allow you to travel from the child node (the one that has the node reference field) to the parent node (the referred node).

For certain applications, we may also need to do the opposite, travel from the parent node (the referred node) to the child node (the one that has the node reference field).

(Thank you markus_petrux for great module)

My Relationships:
Content: "b"
("b") Content reverse references: "b" reverse reference

My Filters:
Node: Type = "A"
("b" reverse reference) Node: Type = "C" (<-- this is needed to avoid duplicated results in view while reusing "b" field for two relationships)

mki’s picture

Status: Fixed » Closed (fixed)