Sorting ExpressionEngine:按相关条目对频道列表进行排序

Sorting ExpressionEngine:按相关条目对频道列表进行排序,sorting,expressionengine,Sorting,Expressionengine,有人能帮我按相关条目标题对频道列表进行排序吗 我有一个频道“团队”,它有一个现场团队区域,该区域依赖于另一个频道“区域” 我的代码如下: {exp:channel:entries channel="teams" orderby="" sort="asc" limit="10"} <tr> <td>{title}</td> <td>{team_address}</td>

有人能帮我按相关条目标题对频道列表进行排序吗

我有一个频道“团队”,它有一个现场团队区域,该区域依赖于另一个频道“区域

我的代码如下:

 {exp:channel:entries channel="teams" orderby="" sort="asc" limit="10"}
    <tr>
          <td>{title}</td>
          <td>{team_address}</td>
          <td>{related_entries id="team_region"}{title}{/related_entries}</td>
    </tr>
 {/exp:channel:entries}
{exp:channel:entries channel=“teams”orderby=”“sort=“asc”limit=“10”}
{title}
{团队地址}
{related_entries id=“team_region”}{title}{/related_entries}
{/exp:channel:entries}
我想按“团队\地区>>标题”对结果进行排序。有可能做到这一点吗


谢谢大家!

为什么不采取相反的方法-从区域频道开始,然后使用列出您的团队。添加一个查询标记以从
{reverse\u related\u entries}
循环中获取区域的标题,您应该准备好了:

{exp:channel:entries channel="regions" orderby="title" sort="asc"}
{reverse_related_entries orderby="title" sort="asc" channel="teams"}
    <tr>
        <td>{title}</td>
        <td>{team_address}</td>
        <td>{exp:query sql="SELECT title as region_title FROM exp_channel_titles t LEFT JOIN exp_relationships r ON r.rel_child_id = t.entry_id WHERE r.rel_id = {team_region} LIMIT 1"}{region_title}{/exp:query}</td>
    </tr>
{/reverse_related_entries}
{/exp:channel:entries}
{exp:channel:entries channel=“regions”orderby=“title”sort=“asc”}
{reverse_-related_条目orderby=“title”sort=“asc”channel=“teams”}
{title}
{团队地址}
{exp:query sql=“从exp\u channel\u titles t LEFT JOIN exp\u relations r ON r.rel\u child\u id=t.entry\u id其中r.rel\u id={team\u region}LIMIT 1”}{region\u title}{/exp:query}
{/reverse_相关_条目}
{/exp:channel:entries}

为什么不采取相反的方法-从区域频道开始,然后使用列出您的团队。添加一个查询标记以从
{reverse\u related\u entries}
循环中获取区域的标题,您应该准备好了:

{exp:channel:entries channel="regions" orderby="title" sort="asc"}
{reverse_related_entries orderby="title" sort="asc" channel="teams"}
    <tr>
        <td>{title}</td>
        <td>{team_address}</td>
        <td>{exp:query sql="SELECT title as region_title FROM exp_channel_titles t LEFT JOIN exp_relationships r ON r.rel_child_id = t.entry_id WHERE r.rel_id = {team_region} LIMIT 1"}{region_title}{/exp:query}</td>
    </tr>
{/reverse_related_entries}
{/exp:channel:entries}
{exp:channel:entries channel=“regions”orderby=“title”sort=“asc”}
{reverse_-related_条目orderby=“title”sort=“asc”channel=“teams”}
{title}
{团队地址}
{exp:query sql=“从exp\u channel\u titles t LEFT JOIN exp\u relations r ON r.rel\u child\u id=t.entry\u id其中r.rel\u id={team\u region}LIMIT 1”}{region\u title}{/exp:query}
{/reverse_相关_条目}
{/exp:channel:entries}
您可能希望从像素和色调角度进行观察。它是一个功能强大的多关系工具,比内置的关系字段有更多的选项

你可能会想用类似的东西

{exp:playa:parents channel="channelname" orderby="title"}

您可能希望从像素和色调角度进行观察。它是一个功能强大的多关系工具,比内置的关系字段有更多的选项

你可能会想用类似的东西

{exp:playa:parents channel="channelname" orderby="title"}

我刚在expressionengine文档中找到一条注释:“按关系字段排序将导致条目按照建立关系的顺序出现,而不是基于相关条目中的任何内容。”我认为这是不可能的:(我刚刚在expressionengine文档中找到一条注释:“按关系字段排序将导致条目按照建立关系的顺序出现,而不是基于相关条目中的任何内容。”我认为这是不可能的(