表达式引擎相关条目下拉值

发布于 2024-12-25 21:04:30 字数 390 浏览 4 评论 0原文

我有2个频道。频道 2 有一个与频道 1 相关的下拉选择框。我想在单个页面上显示有关两个频道的所有信息:

{exp:channel:entries channel="channel1|channel2" require_entry="yes" limit="1"}
{title}
Channel1 info: {tag_from_channel1}
...                             
{reverse_related_entries id="channel2"}
...
{/reverse_related_entries}
{/exp:channel:entries}

我从 {tag_from_channel1} 获取 ID 而不是值。如何显示值而不是 ID?

I have 2 channels. Channel 2 has a dropdown select box relating to channel 1. I want to display all info regarding both channels on a single page:

{exp:channel:entries channel="channel1|channel2" require_entry="yes" limit="1"}
{title}
Channel1 info: {tag_from_channel1}
...                             
{reverse_related_entries id="channel2"}
...
{/reverse_related_entries}
{/exp:channel:entries}

I'm getting ID from {tag_from_channel1} instead of value. How can I display value instead of ID?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遇见了你 2025-01-01 21:04:30

尝试删除 require_entry="yes" 参数,这有助于排除故障:

{exp:channel:entries channel="channel1|channel2" limit="1"}
    {title}

    {reverse_related_entries}
        {title}
    {/reverse_related_entries}
{/exp:channel:entries}

您可以通过使用 dynamic= 对频道条目查询进行硬编码来消除导致问题的 URL,从而进一步调试您的问题“off” 并使用 entry_id="99" 指定单个条目:

{exp:channel:entries ... dynamic="off" entry_id="99"}

此外,{reverse_lated_entries} 标记不应具有 id= 参数。来自 ExpressionEngine 关系文档

与相关条目标签不同,反向相关条目标签可以
不包含 ID 参数,因为没有必要。

您是否打算改用{相关条目}

Try removing the require_entry="yes" parameter, which aide in your troubleshooting:

{exp:channel:entries channel="channel1|channel2" limit="1"}
    {title}

    {reverse_related_entries}
        {title}
    {/reverse_related_entries}
{/exp:channel:entries}

You can further debug your issue by eliminating the URL causing a problem by hard-coding your Channel Entries query with dynamic="off" and specifying a single entry with entry_id="99":

{exp:channel:entries ... dynamic="off" entry_id="99"}

Also, the {reverse_related_entries} tag shouldn't have an id= parameter. From the ExpressionEngine Relationship Documentation:

Unlike the Related Entries tag, the Reverse Related Entries tag does
not contain an ID parameter as there is no need.

Did you perhaps intend to use {related entries} instead?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文