Get entities that share the Entity Reference field Let's say that I have two content types:


Article


title
body
field_ref_term

Page


title
body
field_ref_term



Those two content types are sharing the same field: "field_ref_term" wich is a "Entity reference" field type, to another entity called 'Term' (or something else, it doesn't mind).

What I'm trying to do is, when displaying a particular content of type "Page", I would like to be able to display a list of content in a block who shares the same value for the "field_ref_term" field.

It's a bit like the "Content: Has taxonomy term ID" contextual filter from Views and Taxonomies, where you set the value to "Taxonomy term ID from URL" then check "Load default filter from node page, that's good for related taxonomy blocks".

Do you think this is currently possible with Entity Reference ?

Thanks
I finally found a way to do it, here are the steps:


Add a relationship: Entity Reference: Referenced Entity, select the right field to match, select "Require this relationship"
Add a relationship: Entity Reference: Referencing Entity, selection the just add relationship in step 2 and check "Require this relationship".
Add a contextual filter: Content:nid, provide default value: Content ID from URL
Add a contextual filter: Content:nid, select the relationship "Content referencing...", provide default value: Content ID from URL, then in the More fieldset, check exclude.
Add a field "Title" and select the relationship "Content Referencing..."


I will close this question, feel free to comment or propose other solutions.

Thanks.