0

can someone help me get my head around a relationship field / parent? I have 2 channels. Clinic and People. The people channel has a relationship field to the clinic they work at. When I am displaying the clinic channel I want to display the people that work there. This is not working:

Channel: Clinic Field: Title

Channel: People Field: {member_clinic} relationship field to Clinic

{ exp:channel:entries channel="clinic" limit="1" dynamic="yes"}
Clinic Name: { title }
People at this clinic: {parents channel="people" field="member_clinic"}
                                <div class="show">
                                        <strong>{parents:title}</strong>
                                        <div class="what">{parents:member_lastname}</div>
                                        <div class="when">{parents:member_firstname}</div>
                                </div>
                        {/parents}{ /exp:channel:entries }
1

All you should need is this. Assuming "parents" is the name of the relationship field in the Clinic channel. ref https://docs.expressionengine.com/latest/fieldtypes/relationships.html#accessing-children

{parents}
<div class="show">
<strong>{parents:title}</strong>
<div class="what">{parents:member_lastname}</div>
<div class="when">{parents:member_firstname}</div>
</div>
{/parents}
| improve this answer | |
  • the related field is actually in the people channel not the clinic channel. After more investigation I think my problem is actually with Zoo Visitor. This add on does not know how to handle relationship fields and my people channel uses zoo visitor – Peter Eastwood May 23 '17 at 18:51

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.