Answers.Body: <p>You are returning an elementCriteriaModel (which always returns an array-like object regardless if there is one or more than one result), which you either need to loop over or just grab the first entry (because in this case there can only be one).</p>
  
  <pre><code>{% set gameEntries = craft.entries.section('games').relatedTo(entry) %}
  &lt;h3&gt;Info:&lt;/h3&gt;
  {% for gameEntry in gameEntries %}
      &lt;ul&gt;      
          &lt;li&gt;&lt;a href="{{ gameEntry.url }}" title="{{ gameEntry.title }}"&gt;{{ gameEntry.title }}&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  {% endfor %}
  </code></pre>
  
  <p>or </p>
  
  <pre><code>{% set gameEntry = craft.entries.section('games').relatedTo(entry).first %}
  &lt;ul&gt;      
      &lt;li&gt;&lt;a href="{{ gameEntry.url }}" title="{{ gameEntry.title }}"&gt;{{ gameEntry.title }}&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-27T21:27:57.510Z
Answers.LastActivityDate: 2016-12-27T21:27:57.510Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>I have two sections: 'reviews' and 'games'.
  Games has an field called 'GamesReviews' which is type entries and points to 'reviews'.
  An example of a games entry is located at:
  <a href="http://www.colorcomputergames.com/games/donkey-king" rel="nofollow noreferrer">http://www.colorcomputergames.com/games/donkey-king</a></p>
  
  <p>Towards the bottom, I link to the related reviews for this entry.
  That sends me to:
  <a href="http://www.colorcomputergames.com/reviews/1983-06-01/donkey-king" rel="nofollow noreferrer">http://www.colorcomputergames.com/reviews/1983-06-01/donkey-king</a></p>
  
  <p>At the bottom of the review, I want to link back to the related entry of that review.</p>
  
  <p>I am able to display the name of the game 'Donkey King', but the URL is not pointing to:
  <a href="http://www.colorcomputergames.com/games/donkey-king" rel="nofollow noreferrer">http://www.colorcomputergames.com/games/donkey-king</a></p>
  
  <p>But instead:
  <a href="http://www.colorcomputergames.com/reviews/1983-06-01/donkey-king" rel="nofollow noreferrer">http://www.colorcomputergames.com/reviews/1983-06-01/donkey-king</a></p>
  
  <p>The code I am usinng in the template (reviews/_entry.html) is:</p>
  
  <pre><code>&lt;h1&gt;{{ entry.title }}&lt;/h1&gt;
  &lt;ul&gt;
      {% if entry.ReviewsAuthor|length %}&lt;li&gt;Reviewer: {{ entry.ReviewsAuthor }}&lt;/li&gt;{% endif %}
      {% if entry.ReviewsMedia|length %}&lt;li&gt;Media: {% for category in entry.ReviewsMedia %}&lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;{% endfor %}&lt;/li&gt;{% endif %}
      {% if entry.ReviewsDate|length %}&lt;li&gt;Date: {{ entry.ReviewsDate.format('F Y') }}&lt;/li&gt;{% endif %}
      {% if entry.ReviewsRelatedLink|length %}&lt;li&gt;Related Link: {{ entry.ReviewsRelatedLink }}&lt;/li&gt;{% endif %}
  &lt;/ul&gt;
  {{ entry.body }}
  
  {% set entries = craft.entries.section('games').relatedTo(entry) %}
  &lt;h3&gt;Info:&lt;/h3&gt;
      &lt;ul&gt;      
          &lt;li&gt;&lt;a href="{{ entry.url }}" title="{{ entry.title }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  </code></pre>
  
Tags: <entry><category><relatedto>
Title: Listing related entries to a section
ThreadText: # Listing related entries to a section
  
  (Asked by: username_0 on 2016-12-24)
  
  I have two sections: 'reviews' and 'games'.
  Games has an field called 'GamesReviews' which is type entries and points to 'reviews'.
  An example of a games entry is located at:
  <http://www.colorcomputergames.com/games/donkey-king>
  
  Towards the bottom, I link to the related reviews for this entry.
  That sends me to:
  <http://www.colorcomputergames.com/reviews/1983-06-01/donkey-king>
  
  At the bottom of the review, I want to link back to the related entry of that review.
  
  I am able to display the name of the game 'Donkey King', but the URL is not pointing to:
  <http://www.colorcomputergames.com/games/donkey-king>
  
  But instead:
  <http://www.colorcomputergames.com/reviews/1983-06-01/donkey-king>
  
  The code I am usinng in the template (reviews/\_entry.html) is:
  
  ```
  <h1>{{ entry.title }}</h1>
  <ul>
      {% if entry.ReviewsAuthor|length %}<li>Reviewer: {{ entry.ReviewsAuthor }}</li>{% endif %}
      {% if entry.ReviewsMedia|length %}<li>Media: {% for category in entry.ReviewsMedia %}<a href="{{ category.url }}">{{ category.title }}</a>{% endfor %}</li>{% endif %}
      {% if entry.ReviewsDate|length %}<li>Date: {{ entry.ReviewsDate.format('F Y') }}</li>{% endif %}
      {% if entry.ReviewsRelatedLink|length %}<li>Related Link: {{ entry.ReviewsRelatedLink }}</li>{% endif %}
  </ul>
  {{ entry.body }}
  
  {% set entries = craft.entries.section('games').relatedTo(entry) %}
  <h3>Info:</h3>
      <ul>      
          <li><a href="{{ entry.url }}" title="{{ entry.title }}">{{ entry.title }}</a></li>
      </ul>
  
  ```
  
  **Tags:** entry, category, relatedto
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-12-27. Score: 1
  
  You are returning an elementCriteriaModel (which always returns an array-like object regardless if there is one or more than one result), which you either need to loop over or just grab the first entry (because in this case there can only be one).
  
  ```
  {% set gameEntries = craft.entries.section('games').relatedTo(entry) %}
  <h3>Info:</h3>
  {% for gameEntry in gameEntries %}
      <ul>      
          <li><a href="{{ gameEntry.url }}" title="{{ gameEntry.title }}">{{ gameEntry.title }}</a></li>
      </ul>
  {% endfor %}
  
  ```
  
  or
  
  ```
  {% set gameEntry = craft.entries.section('games').relatedTo(entry).first %}
  <ul>      
      <li><a href="{{ gameEntry.url }}" title="{{ gameEntry.title }}">{{ gameEntry.title }}</a></li>
  </ul>
  
  ```
  
  
  ---
  
  