Answers.Body: <p>I think I worked this out. It looks like the related entries need to be contained in the user loop. This is what I used to make this work:</p>
  
  <pre><code>{% set categoryUsers = craft.users.relatedTo(category) %}
      {% paginate categoryUsers.limit(1) as entries %}
  
          {% for categoryUser in entries %}
              {{ categoryUser.username }}
  
              {% set categoryEntry = craft.entries.section('jobs').authorId(categoryUser.id).first() %}       
                  {% if categoryEntry %}
                      {{ categoryEntry.positionTitle }} (And other fields not added yet.)
                  {% endif %}
  
               &lt;p&gt;Testing the total found: {{ categoryUsers|length }}&lt;/p&gt;
          {% endfor %}
  
      {% if paginate.prevUrl %}&lt;a href="{{ paginate.prevUrl }}" class="pagination left"&gt;&amp;laquo; Previous Page&lt;/a&gt;{% endif %}
      {% if paginate.nextUrl %}&lt;a href="{{ paginate.nextUrl }}" class="pagination right"&gt;Next Page &amp;raquo;&lt;/a&gt;{% endif %}
  
      {% endpaginate %}
  </code></pre>
  
  <p>Still testing, but I think this is the solution. (Unless someone else has a better way of doing this. :)) </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-10T22:34:49.040Z
Answers.LastActivityDate: 2014-10-10T22:34:49.040Z
Answers.UserDisplayName: Angela
Body: <p>This is a category page. I am trying to display all entries from users with this specific category selected in their account (user field that is a category field type.) This is the code I have so far, but it is not returning results. No errors - just not returning anything unfortunately:</p>
  
  <pre><code>&lt;h1&gt;{{ category.title }}&lt;/h1&gt;
  
  {# Grab all the users who have this category selected (which is a 'category field type' user field) #}
  {% set categoryUsers = craft.users.relatedTo(category).limit(null) %}
  
  {# Grab all of the entries by those users #}    
  {% set categoryUserEntries = craft.entries.section('jobs').relatedTo(categoryUsers).limit(null) %}
  
  {% paginate categoryUserEntries.limit(8) as entries %}
  
       {% for entry in entries %} 
           &lt;h1&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/h1&gt;
       {% endfor %}
  
       {% if paginate.prevUrl %}&lt;a href="{{ paginate.prevUrl }}" class="pagination left"&gt;&amp;laquo; Previous Page&lt;/a&gt;{% endif %}
       {% if paginate.nextUrl %}&lt;a href="{{ paginate.nextUrl }}" class="pagination right"&gt;Next Page &amp;raquo;&lt;/a&gt;{% endif %}
  
  {% endpaginate %}
  </code></pre>
  
  <p>Thanks in advance!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-09T17:48:01.370Z
Comments.Text: Add a `{{ categoryUserEntries|length }}` before the pagination part. Does that return anything?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-09T21:56:31.893Z
Comments.Text: This returned '0' although it should return 1 because  1 user has this category selected in the category user field. Testing the first variable - {{ categoryUsers|length }} -  does give the correct amount so it looks like this is an issue with the way the 'relatedTo' is working for this.
Comments.UserDisplayName: Angela
Tags: <entries><relations><category>
Title: Trying to list entries related to users with a specific category selected
ThreadText: # Trying to list entries related to users with a specific category selected
  
  (Asked by: username_0 on 2014-10-09)
  
  This is a category page. I am trying to display all entries from users with this specific category selected in their account (user field that is a category field type.) This is the code I have so far, but it is not returning results. No errors - just not returning anything unfortunately:
  
  ```
  <h1>{{ category.title }}</h1>
  
  {# Grab all the users who have this category selected (which is a 'category field type' user field) #}
  {% set categoryUsers = craft.users.relatedTo(category).limit(null) %}
  
  {# Grab all of the entries by those users #}    
  {% set categoryUserEntries = craft.entries.section('jobs').relatedTo(categoryUsers).limit(null) %}
  
  {% paginate categoryUserEntries.limit(8) as entries %}
  
       {% for entry in entries %} 
           <h1><a href="{{ entry.url }}">{{ entry.title }}</a></h1>
       {% endfor %}
  
       {% if paginate.prevUrl %}<a href="{{ paginate.prevUrl }}" class="pagination left">&laquo; Previous Page</a>{% endif %}
       {% if paginate.nextUrl %}<a href="{{ paginate.nextUrl }}" class="pagination right">Next Page &raquo;</a>{% endif %}
  
  {% endpaginate %}
  
  ```
  
  Thanks in advance!
  
  **Tags:** entries, relations, category
  
  > **Comments:**
  > **username_1**: Add a `{{ categoryUserEntries|length }}` before the pagination part. Does that return anything?  
  > **username_0**: This returned '0' although it should return 1 because  1 user has this category selected in the category user field. Testing the first variable - {{ categoryUsers|length }} -  does give the correct amount so it looks like this is an issue with the way the 'relatedTo' is working for this.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-10-10. Score: 1
  
  I think I worked this out. It looks like the related entries need to be contained in the user loop. This is what I used to make this work:
  
  ```
  {% set categoryUsers = craft.users.relatedTo(category) %}
      {% paginate categoryUsers.limit(1) as entries %}
  
          {% for categoryUser in entries %}
              {{ categoryUser.username }}
  
              {% set categoryEntry = craft.entries.section('jobs').authorId(categoryUser.id).first() %}       
                  {% if categoryEntry %}
                      {{ categoryEntry.positionTitle }} (And other fields not added yet.)
                  {% endif %}
  
               <p>Testing the total found: {{ categoryUsers|length }}</p>
          {% endfor %}
  
      {% if paginate.prevUrl %}<a href="{{ paginate.prevUrl }}" class="pagination left">&laquo; Previous Page</a>{% endif %}
      {% if paginate.nextUrl %}<a href="{{ paginate.nextUrl }}" class="pagination right">Next Page &raquo;</a>{% endif %}
  
      {% endpaginate %}
  
  ```
  
  Still testing, but I think this is the solution. (Unless someone else has a better way of doing this. :))
  
  
  ---
  
  