1

I have a relationship field within my member profile. It allows users to connect to each other, i can list those that currentUser is connected to, but i need to list all other members that are connected to currentUser, i.e. a reverse relationship.

I have this, but it just lists those that the currentUser is connected to, not the reverse, where am i going wrong?

{% set myReverseConnections = craft.users.relatedTo(currentUser) %}
1

Solution:

    {% set myReverseConnections = craft.users.relatedTo({
        targetElement: currentUser,
        field: 'yourCustomRelationshipField'
    }) %}

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.