<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>

CC BY-SA 3.0
2016-12-27T21:27:57.510Z
2016-12-27T21:27:57.510Z
Douglas McDonald
<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>

<entry><category><relatedto>
Listing related entries to a section
# 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:
{{ entry.title }}

    {% if entry.ReviewsAuthor|length %}Reviewer: {{ entry.ReviewsAuthor }}{% endif %}
    {% if entry.ReviewsMedia|length %}Media: {% for category in entry.ReviewsMedia %}{{ category.title }}{% endfor %}{% endif %}
    {% if entry.ReviewsDate|length %}Date: {{ entry.ReviewsDate.format('F Y') }}{% endif %}
    {% if entry.ReviewsRelatedLink|length %}Related Link: {{ entry.ReviewsRelatedLink }}{% endif %}

{{ entry.body }}

{% set entries = craft.entries.section('games').relatedTo(entry) %}
Info:
          
        {{ entry.title }}

**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) %}
Info:
{% for gameEntry in gameEntries %}
          
        {{ gameEntry.title }}
    
{% endfor %}

or 
{% set gameEntry = craft.entries.section('games').relatedTo(entry).first %}
      
    {{ gameEntry.title }}


---

