Score:1

Add relationships that has 3 layers, Parent -> Child1 -> Child2

sa flag

Recently I asked a question that was similar (Parent node needs to display the scheduled date that is referenced in the child node), but requirements have changed and now I'm dealing with the Node A (parent) -> Node B (child) -> Node C (grand-child). Bear with me as I explain this.

Node A is the main parent. It contains an entity reference field that calls Node B. I've successfully created the contextual filter and relationship to display the necessary information from both Node A and Node B. Entering the mix is Node C. Node C contains one piece of info that needs to be displayed. There is an entity reference field in Node B that calls Node C.

I currently have a contextual filter and relationship on the Node B entity reference field, but the field from Node C isn't displaying. I'm sure this has to do with there being 3 layers to this view. Is there something here that I'm missing, or is views unable to handle the 3 layer relationship?

Score:1
sa flag

Well, that didn't take much time at all. After doing a bit more searching around, I came up with the following solution.

Under "Relationships" I created another one on the entity reference field used in Node B. Then I assigned the relationship that was created for the Node A entity reference field to this new relationship. Note: the relationship is NOT required because some items do not contain the info from Node C.

Next, under "Fields" I updated the relationship used for the field containing the info from Node C to reference this new relationship. All fields display as/when they should.

I hope this helps someone else out. Cheers.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.