0

I have a Matrix field with a Playa field in it. I'd like to sort the output of the Matrix using a text field from the Playa field. Is that possible?

Here's my code; I'd like to be able to sort by {former_member_info:people_n_family}:

{exp:channel:entries channel="org_units" status="open" dynamic="yes" disable="{mcc_disable_mem_pag}" limit="1" require_entry="yes"}
{org_units_members_mtx var_prefix="former_members"}
        {former_members:org_units_member_name_rel var_prefix="former_member_info"}
        <tr>
            <td width="25%">{former_member_info:people_n_first} {former_member_info:people_n_family}</td>
            <td width="35%">{if '{former_members:org_units_member_title}' != ""}{former_members:org_units_member_title}{if:else}{former_member_info:people_title}{/if}</td>
            <td width="20%">{former_members:org_units_member_date_start format="%F %j, %Y"}</td>
            <td width="20%">{former_members:org_units_member_date_end format="%F %j, %Y"}</td>
        </tr>
        {/former_members:org_units_member_name_rel}
{/org_units_members_mtx}{/exp:channel:entries}
2
  • What does {former_member_info:people_n_family} output as? docs.pixelandtonic.com/matrix/templating/field.html tells me that you can either have a fixed, ascending, descending, or random sort order
    – jrothafer
    Mar 26, 2015 at 16:56
  • The code is part of a table that displays a list of people. The first column displays the first and last name. {former_member_info:people_n_family} outputs the last name. If I set the orderby parameter on the matrix tag to {org_units_member_name_rel} (which is the name of the Playa Matrix field) it orders the table by the Playa field's entry ID.
    – Brett
    Mar 26, 2015 at 21:26

1 Answer 1

0

The answer is that this isn't currently possible. I had a Twitter conversation with Brad and Andris at Pixel and Tonic. Here's the conversation: https://twitter.com/BertBartBrett/status/583301880471773184

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.