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">« Previous Page</a>{% endif %}
{% if paginate.nextUrl %}<a href="{{ paginate.nextUrl }}" class="pagination right">Next Page »</a>{% endif %}
{% endpaginate %}
Thanks in advance!
{{ categoryUserEntries|length }}
before the pagination part. Does that return anything? – Brad Bell Oct 9 '14 at 17:48