ExpressionEngine:自定义URL的多个渠道问题

时间:2012-08-13 23:45:02

标签: expressionengine

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

网址格式如此 http://build.jhousemedia3.com/pleasanton/[channel]/[template]/[query parameter]

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

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

有什么想法吗?

根据网址提取购物区资料的代码:

{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}

1 个答案:

答案 0 :(得分:1)

可能很明显,但是你在其他循环中添加了dynamic =“no”吗?

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