I have two categories, Annual Reviews and Publications. I want to get all entries from these and paginate them.
The code I am using is fine for one category - both work individually, but as soon as the criteria contains two categories i get zero results no errors. I have tried using 'one()' on the initial categories as I only want category returned. What am I missing? (using Craft Pro 3.1.31)
{% set publications = craft.categories.group('resources').slug('publications') %}
{% set annualreviews = craft.categories.group('resources').slug('annualreviews') %}
{% set entries = craft.entries({
section: 'resources',
relatedTo: [
'and',
{ targetElement: publications },
{ targetElement: annualreviews }
]
}).limit('10').orderBy('title') %}
{% paginate entries as pageInfo, pageEntries %}
'and'
? Or are you meaning "get all entries that have apublications
orannualreviews
category? – Brad Bell Jun 25 '19 at 22:11