1

I have a channel section (tickets) where each entry has a members field. The members field can either be empty (making the entry 'public') or specific members can be added (making it 'private', to only the selected users).

I want to get a list of all the entries within the section where the members field is either empty or the currentMember has been added to the list, e.g. a member should see both public entries and private entries they have been added to.

I'm using the following to get all private entries for the currentMember, but I can't figure out how to make it include the public ones as well.

{% set tickets = craft.entries.section('tickets').relatedTo({
    targetElement: currentMember,
    field: 'members'
}) %}
  • Man, that's exactly what I would need too. Any progress on this? – outline4 Sep 4 '17 at 14:47
  • Any progress on this? I have the exact same problem to solve... – Joel Lachance Sep 6 '19 at 15:37

Your Answer

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

Browse other questions tagged or ask your own question.