Answers.Body: <p>Everything you need to know is in the <a href="http://buildwithcraft.com/docs/relations" rel="nofollow">Relations</a> part of the official documentation.</p>
  
  <p>You essentially want to add an <a href="http://buildwithcraft.com/docs/entries-fields" rel="nofollow">Entries</a> field to your <code>Courses</code> channel and then when you set it up pick <code>Instructors</code> as the source. If you only want to pick one instructor, just set the <code>limit</code> to 1. How you then use this in the templates can be found <a href="http://buildwithcraft.com/docs/entries-fields#templating" rel="nofollow">here</a>. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-11T00:34:41.783Z
Answers.Text: So I've tried using the code `{% for entry in entry.instructor %} ... {% endfor %}` but all I get is a 500 Fatal error. I was using the documentation before but as I mentioned above I can't seem to figure out the precise code that would get it to work and the documentation has so much assumed knowledge that I can't figure it out.
Answers.UserDisplayName: JeffTalbot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-11T00:45:33.080Z
Answers.Text: I've tried many other variations like `{% for instructors in courses.instructor %} ... {% endfor %}` but none seem to work. To me that code is exactly like the example `{% for ingredient in cocktail.ingredients %}
              <li>{{ ingredient.getLink() }}</li>
          {% endfor %}` but it doesn't work and I really don't understand why...
Answers.UserDisplayName: JeffTalbot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-11T00:54:00.900Z
Answers.Text: So the winner is `{% for instructors in entry.instructor %}` I found that also there was come other code from when the instructor field was just a text field that was causing issues. Thanks for the help.
Answers.UserDisplayName: JeffTalbot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-11T08:50:01.853Z
Answers.Text: Glad you got it sorted in the end. It's because you can have one or many in your relationship so an array is returned. I don't know how many instructors you are assigning to each course, but if there was only ever one you could use `{% set instructor = entry.instructor.first() %}` which would bring you back just the one, or `null` (I think) if you haven't yet assigned one.
Answers.UserDisplayName: Steve Holland
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-10T08:40:16.867Z
Answers.LastActivityDate: 2015-06-10T11:46:13.320Z
Answers.LastEditDate: 2015-06-10T11:46:13.320Z
Answers.UserDisplayName: Steve Holland
Body: <p>I have two channels, Courses and Instructors. In Courses I'd like to have a an entries field called "Instructor" so that this will display on the courses page.</p>
  
  <p>I can't seem to figure out how to do this. I have found a few tutes but nothing I have tried has worked. Whats the best way of doing this?  </p>
  
Tags: <entries>
Title: Trying to relate 2 Entries together
ThreadText: # Trying to relate 2 Entries together
  
  (Asked by: username_0 on 2015-06-10)
  
  I have two channels, Courses and Instructors. In Courses I'd like to have a an entries field called "Instructor" so that this will display on the courses page.
  
  I can't seem to figure out how to do this. I have found a few tutes but nothing I have tried has worked. Whats the best way of doing this?
  
  **Tags:** entries
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-10. Score: 4 | Accepted answer
  
  Everything you need to know is in the [Relations](http://buildwithcraft.com/docs/relations) part of the official documentation.
  
  You essentially want to add an [Entries](http://buildwithcraft.com/docs/entries-fields) field to your `Courses` channel and then when you set it up pick `Instructors` as the source. If you only want to pick one instructor, just set the `limit` to 1. How you then use this in the templates can be found [here](http://buildwithcraft.com/docs/entries-fields#templating).
  
  > **Comments:**
  > **username_0**: So I've tried using the code `{% for entry in entry.instructor %} ... {% endfor %}` but all I get is a 500 Fatal error. I was using the documentation before but as I mentioned above I can't seem to figure out the precise code that would get it to work and the documentation has so much assumed knowledge that I can't figure it out.  
  > **username_0**: I've tried many other variations like `{% for instructors in courses.instructor %} ... {% endfor %}` but none seem to work. To me that code is exactly like the example `{% for ingredient in cocktail.ingredients %}             <li>{{ ingredient.getLink() }}</li>         {% endfor %}` but it doesn't work and I really don't understand why...  
  > **username_0**: So the winner is `{% for instructors in entry.instructor %}` I found that also there was come other code from when the instructor field was just a text field that was causing issues. Thanks for the help.  
  > **username_1**: Glad you got it sorted in the end. It's because you can have one or many in your relationship so an array is returned. I don't know how many instructors you are assigning to each course, but if there was only ever one you could use `{% set instructor = entry.instructor.first() %}` which would bring you back just the one, or `null` (I think) if you haven't yet assigned one.  
  
  ---
  
  