I have a content type "A" that has an entity reference field to content type "B".

I need to create a view that will be embed on "A" node page for listing all "B" nodes referenced to it.

I know I have to use contextual filters for getting the current node id and a relationship, but not sure exactly the recipe.

  • Use A nid as a contextual filter and list the ERR field as a link to the entity.
    – Kevin
    Jan 24, 2018 at 14:33

1 Answer 1

  1. Create a view of content type B. (View Type Block)
  2. Create a relationship in that view to the content that contains the reference field by clicking on add a relationship, and search for the name of your reference field)
  3. Create a contextual filter to filter by ID using that reference field. Choose "Provide default value" then "Content ID from URL".
  4. Display your block on the appropriate pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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