I have a bit of a complex relationship situation I'm trying to figure out in EE.
My channels consist of case-studies, clients, and services.
- I have a relationship field within each case-studies entry where I relate a client and service.
- Within the clients channel I relate items from the service channel.
I want to create tab-based clients page that lists clients segmented by the 4 services, with a link under each client to a page that lists their related case-studies.
Now I can list the clients fine, and the tabs are working the way they should, the problem I'm having is checking whether a client has related case studies or not and only displaying a link to that page IF that client has some related case-studies.
{exp:channel:entries channel="services" entry_id="4"}
<!-- I'm in the services channel, now I want to loop through the clients that are related to this service -->
{parents field="client_related_service"}
<div class="col-xs-12 col-sm-6 col-md-3 client-details">
<p> <img src="{parents:client_logo}" class="img-responsive" alt="{title}"/></p>
<p> {parents:client_description} </p>
<!-- ONLY ADD THIS IF CLIENT HAS CASE-STUDIES RELATED TO IT, CAN'T FIGURE OUT HOW TO DO THIS-->
<p> <a href="{site_url}index.php/clients/{parents:url_title}">See how we helped {parents:title}</a> </p>
</div>
{/parents}
{/exp:channel:entries}