1

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?

3

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, privacy policy and cookie policy

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