Problem/Motivation
I have a one-many relationship between two content types B and C implemented as B containing an entityreference field to C.
I have a one-one relationship between content types A and B implemented as A containing a single entityreference field to B .
I am using a Drupal core block view to list nodes of type C from any node of type B with a contextual filter set to: Provide default Value (content ID from URL)
This works fine when viewing the parent node of type B from its own page.
I want to be able to specify listing nodes of type C referenced by B which is in turn referenced by a node of type A.
This is not possible using Drupal core views functionality "Provide default value (content ID from URL" and I would like to know how to list C's contained in B's contained in A's
Steps to reproduce
Create content types A, B and C
Add an one-one entityreference B to A
Add a one-many entityreference C to B
Create a view to display C nodes in B
Note it works fine when viewing B
Create a node of type A containing a reference to node type B previously created
View A and note the view breaks as the URL now references node type A not B.
Proposed resolution
Add a new option in Views contextual filters to: Provide default value (content ID from parent node) in addition to the existing "content ID from URL". This would allow arbitrary layers of nesting.
Remaining tasks
TBD
Comments