Using a view to attach fields from a content type to another one I am a bit new to this, but I do have a programming background, and I have been working with Drupal for a while.

I am putting together a site for our Yoga Studio and I have a content type (scheduled class)  that has a field (field scheduled_class) that is a node reference to a content type (class description). The Scheduled Class content type has as field for date which is used in a calendar, and there are multiple classes using the same class description.

I am trying to use a view to attach fields from the class description to the scheduled class content type and I cannot get it to work. I have been banging my head against the wall for months now.


                               --> fields
Scheduled class --> Class Type --> fields   
                               --> fields


I have not been able to get the contextual filter and relationship set up properly to allow this to work. I have tried every single combination I can think of. I am pretty sure the source of the problem is trying to get the right default value of the Class Type, but I am not sure.
What I would do:

Enable the query preview under Views settings.


Create a new View.
Make sure "Title" is a selected field, and that the titles of both "Scheduled classes" and "Class type" is available in the list.
Add a new relationship, pick the one representing your node-reference. Make it required.
Change the title-fields configuration to select the newly added the relationship.
You should now only have titles from "Class type".


From there on, you likely want to add a contextual filter on a nid so you can pick out "Class type" from a specific "Scheduled class".

I haven't used references in a while. If you get stuck already here, give the same thing a try with entity reference instead, just to see if it plays better together with Views.

Also see Learn Views with NodeOne, episode 11 is specifically about relationships.