I am trying to construct a page template where I display node information in the content area, and some views in a sidebar that display data from another node type. I am using the Entity Reference module. I am displaying apartment units, and these unit content types have a many-to-one relationship to its community complex. So, when the user views the unit profile, its community data will pop up on the side.

Anyone know the best way to go about doing this?

2 Answers 2


Have a node_reference field in the content type Apartment Unit.

Use node id from content as the contextual filter.

Use the node_reference field as a relationship in the view that you create. When you go to the fields section now(after adding the relationship), now you can add the fields from the referenced community complex.

  • Should I install the References module and not the Entity Reference module? I removed the reference I had from the community content type and added it to the apartment unit type. So, when we add a new unit, we'll just select the community it belongs to. However, the contextual filter doesn't seem to work. I set the filter to the field (that resides in the Community content type).
    – vintorg
    Dec 24, 2012 at 20:09
  • My bad, I have updated the description.
    – Gokul N K
    Dec 24, 2012 at 20:13
  • Actually, I spoke too soon. All apartment units are showing up for any community.
    – vintorg
    Dec 24, 2012 at 20:50
  • On a apartment page, you wanted to display the data regarding community right?
    – Gokul N K
    Dec 24, 2012 at 21:01
  • Actually, both ways. On an Apartment, I want to display community information. In a community, I want to display properties of that community. I'm making it confusing....
    – vintorg
    Dec 24, 2012 at 21:09

I figured it out. In the view, in Relationships, choose Entity Reference: Referencing Entity. Click 'Require this relationship'. Next, add a Contextual filter for Content:Nid. Under Relationship, select the ID you set up in Relationships.

For 'When the filter is NOT available', select 'Provide default' with 'Content ID from URL'. Below that, for when filter IS available, select Validator.

That worked for me.

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.