ExpressionEngine:按相关条目对频道列表进行排序
有人可以帮我按相关条目标题对频道列表进行排序吗?
我有一个频道“teams”,其中有一个字段 team_region,该字段依赖于另一个频道“regions”。
我的代码如下:
{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}
我想按“team_region>>”对结果进行排序标题'。有可能实现这一目标吗?
谢谢你!
Can someone help me in sorting a channel listing by Related entry title please?
I have a channel 'teams' which has a field team_region which depends on another channel 'regions'.
My code is as follows:
{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}
I want to Sort the result by 'team_region >> title'. Is it possible to achieve this?
Thank You!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不采取相反的方法 - 从“区域”频道开始,然后使用反向相关条目 列出您的团队。添加一个查询标记以从
{reverse_lated_entries}
循环中获取区域的标题,然后您就可以开始了:Why not take the opposite approach - start with the Regions channel, then use reverse related entries to list your teams. Add a query tag to grab the region's title from within the
{reverse_related_entries}
loop, and you should be good to go:您可能想查看 Pixel 和 Tonic 的 Playa。它是一个强大的多关系工具,比内置关系字段有更多的选项。
您可能想要使用类似
链接到文档 →
You might want to look at Playa from Pixel and Tonic. It's a powerful multi-relational tool with tons more options than the built-in relationships field.
You'll probably want to use something like
Link to docs →