There is a set of entries:

{% set entries = craft.entries.section('news') %}

Each entry has a custom field customUserField. customUserField this is a field Users. How do you fetch entries where customUserField === currentUser?

1 Answer 1


Something like this should do it:

{% set entries = craft.entries.section('news').relatedTo({
    targetElement: currentUser,
    field: 'customUserField'
}).find() %}

More on the relatedTo method here: https://craftcms.com/docs/relations


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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