このページ: http: //build.jhousemedia3.com/pleasanton/shop/district-profile/stoneridge-shopping-center/
URLは次のようにフォーマットされていますhttp://build.jhousemedia3.com/pleasanton/[channel]/[template] / [query parameter]
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}