Search code examples
drupaldrupal-6drupal-viewsdrupal-views-relationship

Displaying multiple fields on a "node reference field"


I've been struggling for a while with this problem and I'm curious if anyone has any thoughts:

I have two related content types on my website -- "Institutes" and "Projects". On a single Institute page I would like to display a preview of multiple Project content types that are related to that institute. This would mean for each preview pulling three fields from the Project page -- the main project picture, the title, and the project description.

Currently I have a "node reference" field on a Institute content type where you can select which Projects are related to the Person. Of course without Views it only shows the title of the Project. I just can't figure out how to use Views here to display the fields I want.

At this point I have a Block View with a Relationship selecting my node reference. I'm having trouble understanding how I can use that relationship to show fields of corresponding Project content types though.

Does anyone have any idea? I'm sure it's right in front of my face, I just need a push in the right direction.

Thank you so much in advance, to anyone willing to give advice.

-Maxime


Solution

  • Try this:

    1) Create your view with the filter "Content Type: Projects" and configure the fields and display /style as usual... 2) Then add a argument of the "Institute reference field" or whatever you called on the Project page. Then set the default value of the argument to be "Node ID from URL"

    When the block or whatever is displayed on a Institute page it will display the projects that reference it.

    I hope I understood your question :)