Sort Collection by Related Collection

This is my first time using the "COLLECTION" field type and I'm unsure how to use this field for sorting a collection.

Here's the scenario: I have 2 collections that I'm working with.

1st Collection is Team Members. Each item in the collection is individual information about the team member (such as title and bio).

2nd Collection is Company Resources. This collection has category (infographic, blog, video, etc), thumbnail picture and title. I've added a NEW COLLECTION field called "associate_with" that let me select the Team Member who authored the blog post or resource.

So, what I'd like to do is on each Team Member's bio page is to display the Resources that the specific team member authored.

The non-sorted code is below:

{{ collection:resources }}
            <div>
                <article>

                {{ if video }}
                <a href="{{ url }}">
                    {{ else }}
                <a href="{{ resource_url }}">
                    {{ /if }}
{{ assets:thumbnail }} <img src="{{ url }}" />{{ /assets:thumbnail }}

                <p>{{ foreach:type }}{{ value }}{{ /foreach:type }}</p>
                <p>{{ title }}</p></a>              
</article>
            </div>
{{ /collection:resources }}

On the Individual team member's pages, I'm calling their content by this (name, bio, headshot etc).

{{ collection:people location:is="{title}" }}

So, the slug of their page matches the title of the Team Member Collection Entry.

How does the relate tag work in this scenario? {{ relate:associate_with.title }}

Again, my goal is to sort the resources by the related team member's title.

To be specific, what can I add to {{ collection:resources }} to filter/sort by the "associate_with" value in Collection:People matching the {{ title }} or slug of the page where this code is placed?

Thanks!

Answered by Kelly!
>>>>>>> Answered <<<<<<<
2 Replies
2 Followers