<p>The problem seemed to be caused by a bad relation. Removing the relation and re-creating the relationship between the User and entries fixed the issue. Dunno what caused it but it was very strange.</p>

CC BY-SA 3.0
2014-12-09T09:31:32.800Z
2014-12-09T09:31:32.800Z
Sean Delaney
<p>Have you tried this:</p>

<pre><code>{% set currentMemberNews = craft.entries.section('news').relatedTo({
    targetElement: currentMember,
    field: 'yourFieldHandle',
}) %}
</code></pre>

<p>To specifically define the correct field and the fact that the member is on the target side of this relation?</p>

CC BY-SA 3.0
2014-12-09T09:10:55.987Z
You won by 8secs!
carlcs
CC BY-SA 3.0
2014-12-09T09:11:48.760Z
Great minds think alike ;)
Paul
CC BY-SA 3.0
2014-12-09T09:12:05.180Z
yourFieldhandle - do you mean the Users field handle in my News Channel ?
Sean Delaney
CC BY-SA 3.0
2014-12-09T09:13:37.040Z
You define the field in which the relationship was initialized. In this case, the User field in your news channel. The big question, however ... does it work?
Paul
CC BY-SA 3.0
2014-12-09T09:14:18.773Z
Okay, I've tried the above and I still get my 7 entries. :(
Sean Delaney
CC BY-SA 3.0
2014-12-09T09:14:56.823Z
Could you show me how you loop through your entries?
Paul
CC BY-SA 3.0
2014-12-09T09:19:42.627Z
`{% set currentMemberNews = craft.entries.section("news").relatedTo({targetElement: currentMember,field: "genericRelatedMembers",}).status("live") %}
FOUND: {{ currentMemberNews | length }}
{% if currentMemberNews | length %}
{% for article in currentMemberNews %}{{ article.title}}<br>{% endfor %}{% endif %}`
Sean Delaney
CC BY-SA 3.0
2014-12-09T09:21:44.257Z
Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/19313/discussion-between-sean-delaney-and-paul-verheul).
Sean Delaney
CC BY-SA 3.0
2014-12-09T09:10:19.180Z
2014-12-09T09:10:19.180Z
Paul
<p>I know this question has been asked a few times but no of the answers work.</p>

<p>I have a News channel with a Users field type as one of the layout fields.</p>

<p>I want to find all news entries related to user id X but the entries returned are wrong.</p>

<pre><code>{# Get current member e.g URL /members/1/ #}
{% set currentMember = craft.users.id(craft.request.segment(2)).first() %}

{# Get current members news entries #}
{% set currentMemberNews = craft.entries.section("news").relatedTo(currentMember) %}
</code></pre>

<p><code>currentMemberNews</code> contains all news. I just want the <code>currentMember</code> news.</p>

<p>Not sure what I am doing wrong?</p>

CC BY-SA 3.0
2014-12-09T08:51:34.450Z
`{{ currentMember.email }}` prints what you expect it to?
carlcs
CC BY-SA 3.0
2014-12-09T09:04:10.313Z
Yes, the correct email address is printed out.
Sean Delaney
CC BY-SA 3.0
2014-12-09T09:04:57.540Z
There are 7 news entries in the system with only 2 news entries tagged to the current member.  I get all 7 news entries.
Sean Delaney
<entries><users><relations>
Entries related to Users
# Entries related to Users

(Asked by: username_0 on 2014-12-09)

I know this question has been asked a few times but no of the answers work.
I have a News channel with a Users field type as one of the layout fields.
I want to find all news entries related to user id X but the entries returned are wrong.
{# Get current member e.g URL /members/1/ #}
{% set currentMember = craft.users.id(craft.request.segment(2)).first() %}

{# Get current members news entries #}
{% set currentMemberNews = craft.entries.section("news").relatedTo(currentMember) %}

currentMemberNews contains all news. I just want the currentMember news.
Not sure what I am doing wrong?

**Tags:** entries, users, relations
> **Comments:**
> **username_1**: `{{ currentMember.email }}` prints what you expect it to?  
> **username_0**: Yes, the correct email address is printed out.  
> **username_0**: There are 7 news entries in the system with only 2 news entries tagged to the current member.  I get all 7 news entries.  

---

## 2 answers

### Answer by username_0 on 2014-12-09. Score: 1 | Accepted answer

The problem seemed to be caused by a bad relation. Removing the relation and re-creating the relationship between the User and entries fixed the issue. Dunno what caused it but it was very strange.


---

### Answer by username_2 on 2014-12-09. Score: 1

Have you tried this:
{% set currentMemberNews = craft.entries.section('news').relatedTo({
    targetElement: currentMember,
    field: 'yourFieldHandle',
}) %}

To specifically define the correct field and the fact that the member is on the target side of this relation?

> **Comments:**
> **username_1**: You won by 8secs!  
> **username_2**: Great minds think alike ;)  
> **username_0**: yourFieldhandle - do you mean the Users field handle in my News Channel ?  
> **username_2**: You define the field in which the relationship was initialized. In this case, the User field in your news channel. The big question, however ... does it work?  
> **username_0**: Okay, I've tried the above and I still get my 7 entries. :(  
> **username_2**: Could you show me how you loop through your entries?  
> **username_0**: `{% set currentMemberNews = craft.entries.section("news").relatedTo({targetElement: currentMember,field: "genericRelatedMembers",}).status("live") %} FOUND: {{ currentMemberNews | length }} {% if currentMemberNews | length %} {% for article in currentMemberNews %}{{ article.title}}<br>{% endfor %}{% endif %}`  
> **username_0**: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/19313/discussion-between-sean-delaney-and-paul-verheul).  

---

