1

I'm trying to exclude an entry based on the state of a lightswitch field in the entry itself. If true, exclude the entry from the feed, if false include the entry.

1
  • Hi Alan. It would help us help you if you explained what you tried already. – nstCactus Jul 19 at 6:45
1

For anyone else who happens to land on this trying to solve your similar challenge:

Super simple - the criteria can accept a custom field value, so in my case, the criteria became

'criteria' => [
    'section' => 'caseOfTheMonth',
    'type' => 'standard',
    'hideFromFeed' => false,
],

What was getting in the way, in my case, was that I was fighting the Element API response cache when I was trying all my options, so I completely missed the most simple solution. That's my takeaway - manage that cache when testing!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.