Troubles with displaying content in a sidebar block with a View. Actually, the website is in Dutch, so I'll replace the names of Content Types with something easier, like A, B, C, D.

I have 4 entity types: A, B, C, and D. These are articles referencing each other. So, a node for entity type A on the screen, has additional relevant information in B, C, and D.
While the node from entity type A is on the screen, I want to display the links to the different nodes in B, C and D in a sidebar block.

So in each entity type, I have Entity Reference fields, for example a node from type A has fields refB and refC and refD.

All working fine, with the links being correctly displayed within the node display, and I can jump between content from each entity type using the Entity Reference fields.

So, for the sidebar block, I created a View that contains the refB and refC and refD fields, and added a relationship (just for refB initially, to reference the content in entity type B), and a contextual filter on the Nid, getting the value from "Entity from URL".

Nothing gets displayed in the block however.
When I remove the contextual filter, all possible values for the entity reference fields are displayed. So either I'm getting everything or nothing, but not the relevant entity reference fields from the node in entity type A only.

Articles on this subject explain the Relations and Contextual Filter configuration, but can't get it right apparently.

  • Notice that you are stating facts, but you aren't asking any explicit question. Stack Exchange doesn't work well with implicit questions. (The question title doesn't count as asking an explicit question.) – kiamlaluno Feb 4 '17 at 15:53

I think it's because you did not select a Relationship in your field.

Example: Title field (By the way, field_test is my entity ref field name)

enter image description here

Also make sure your contextual filter does not have a relationship

enter image description here


Solved the problem already. Apparently I was making this too complex. Created a new view, just adding the refA, refB, refC and refD entity fields. Then a contextual filter with Nid as "Content ID from URL"

And that's it, working fine. No relationships required apparently. Because the Entity reference already contains the "relationship info".

I think a Relationship is only required if one wants to match nodes on specific content in fields ?

So in this case, no relationship link required.

  • So pretty much what I've said, nothing new here. – No Sssweat Feb 5 '17 at 0:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.