【问题标题】:ExpressionEngine: Multiple channels issue with custom URL'sExpressionEngine:自定义 URL 的多个渠道问题
【发布时间】:2012-08-13 23:45:01
【问题描述】:

在此页面上: http://build.jhousemedia3.com/pleasanton/shop/district-profile/stoneridge-shopping-center/

网址格式如下 http://build.jhousemedia3.com/pleasanton/[频道]/[模板]/[查询参数]

我正在使用 URL 的最后一段 (segment_4) 运行 exp:channel:entries 查询

发生的情况是,当我从这个 URL 运行它时,我无法从除特定购物区频道之外的任何其他频道提取数据。如果我要将最后一段更改为 /?id=28 (或类似的),我可以从多个通道中提取数据。

有什么想法吗?

根据URL拉取商圈简介的代码:

{exp:channel:entries url_title="{segment_4}" limit="1" channel="shopping_districts"}
    <h2 class="upper"><span class="greenlight">{title}</span></h2>
    {if center_website}
        <div class="greyroundbox right"><a href="{center_website}" class="external-link" target='_blank'>Visit the Website</a></div>
    {/if}
    <p>{shopping_center_description}</p>
    <div class="clear"></div>
{/exp:channel:entries}

用于提取任何业务数据的代码

{exp:channel:entries channel="businesses"}
    <li class="{switch='first|'}">
        <p>
        <a href="{path='pages/business-profile'}" class="main-title">{business_name}</a>
        <a href="{path='pages/shopping-category'}" class="green-title">{categories_shopping}</a><br />
        {if phone}
            <strong>Phone</strong>: {phone}<br />
        {/if}
        <strong>Address</strong>: {address_1}<br />
        {if address_2}
            {address_2}<br />
        {/if}
        {city}, {state}, {zip}<br />
        {if website}
            <a href="{website}" class="grey"><em>{website}</em></a>
        {/if}
        </p>
    </li>
{/exp:channel:entries}

【问题讨论】:

  • 听起来像是一个非常具体的模板设置。发布 district-profile 模板中的代码会很有帮助。

标签: expressionengine


【解决方案1】:

也许很明显,但是您是否在其他循环中添加了 dynamic="no"?

{exp:channel:entries channel="businesses" dynamic="no"}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-19
    • 1970-01-01
    • 2017-11-19
    • 2020-07-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多