I'm adding prev/next links to a detail page and can't get craft.entries
to return the correct entries.
Specifically, I need craft.entries
to return entries in the "leadership" section where the entry type (leadershipType
) matches the current entry's entry type (leadershipType
).Specifically, I need craft.entries
to return entries in the "leadership" section where the leadershipType
field matches the current entry's leadershipType
value.
My code returns all entries instead of the ones specific to my field parameter.
{% set params = craft.entries.section('leadership').find({ leadershipType:entry.leadershipType }) %}
{% set prev = entry.getPrev(params) %}
{% set next= entry.getNext(params) %}?
{% if prev %}<a href="{{ prev.url }}"><</a>{% endif %}
{% if next %}<a href="{{ next.url }}">></a>{% endif %}