Hi all, I’ve used Playa to create several relationships (and quite easily) between a client’s entries regarding their attorneys and their multiple practice areas. The Playa functionality works without any hiccups and displays those practice areas perfectly.
However, I’m running into an issue with the reverse_related_entries on the Practice Areas page as the client wants those divvied up between the various Attorney rankings (Partner, Associate, etc.). The only way I can return this info is by using this code:
<h3 class="tg">Partners</h3>
<ul>
{exp:weblog:entries weblog="practice_areas|specialties"}
{reverse_related_entries}
{if job_title == "Partner"}
<li><a href="http://{site_url}index.php/attorneys/detail/{url_title}">{title}</a></li>
{/if}
{/reverse_related_entries}
{/exp:weblog:entries}
</ul>Clearly, the problem with that method is that if there isn’t anything matching “Partner” (in this example), then it will display a header with no data below it. This isn’t acceptable for the client, so I’m looking into using the Custom Query Module.
However, I’m in the dark on how to search for a relationship’s values and return info matching it. It’d be one thing if I could easily parse and find out the relationship, but I’m afraid I’m in the dark on how to find this information. Do I have to join the weblog titles, weblog data and the weblog relationships together in this query? If so, what would I need to do?
I’m sorry if I’m asking anything incorrectly. I’m just very new to the custom query module, and don’t know where to start in this instance! 😖