How do I create a view that shows the results of a content type related to the current page? I have two content types on my site: "mountains" and "trip reports" with the idea being that users can create a trip report for any particular mountain they have visited.

My "trip reports" content type uses an entity reference field so that the user can select from the list of "mountains" content type.

I want to create a view to display as a block on the "mountains" pages that lists the recent trip reports associated with that mountain.  How do I structure my filter in Views?  I can either get all trip reports to show up (i.e. trip reports associated with all mountains, or none to show up!

Here's my current view setup:

Fields:


Content: Title


Filter Criteria:


Content: Published (Yes) 
Content: Type (= Trip Report)


Contextual Filters:


Content: Title


Relationships:


Entity Reference: Referencing entity
You need to include a Node ID contextual filter as well that is set to Content ID from URL. Then make sure that each of the Fields are set to relate to the relationship entity reference field you are using. I'll try to explain below.

Adding a Contextual Filter that looks for the Content ID from URL is required as the view will use the found nodeID and use that to know what node it should relate it's fields and relationships too.

You will then want to add a Relationship field that is the Entity Reference field that creates the relationship between the Trips (children) and the Mountain (parent). 

Now with the fields, if you just add fields and do not modify any settings, the view will only display content that is available in the original node. For instance, adding the Title field will display the title of the Mountain and not the title of the Trip reports. This is because it doesn't know it should get the information from anywhere else, even though we added the Relationship field before.

This is why you need to modify the fields and set their Relationship to the Entity Reference field. This will now tell the view that even though we are on the Mountain node and have it's ID, the fields are going to output the content related to the entity that is referenced by the nid in the contextual filter.