比如會(huì)員空間在news模型(模型id=1)建了幾個(gè)欄目,
{list action=model modelid=10 space=$spaceid num=10 order=updatetime}
標(biāo)題:{$t.title}
欄目名稱:{$category[$t.catid]['name']}
欄目地址:{dr_space_list_url($spaceid, $t.catid)}
內(nèi)容地址:{dr_space_show_url($spaceid, 10, $t.id)}
地址有點(diǎn)特殊,第二個(gè)參數(shù)10是模型的id號(hào)
一般就只會(huì)調(diào)用這兩個(gè)吧
更新時(shí)間:{$t.updatetime}
自定義更新時(shí)間:{dr_date($t._updatetime, 'Y-m-d')}
{/list}
{$error}錯(cuò)誤信息顯示用上面的能調(diào)用出這個(gè)模型的文章列表和欄目名稱、地址。
怎么能按照欄目分開(kāi)呢?按欄目循環(huán),顯示個(gè)欄目下面的文章列表。
應(yīng)該比較麻煩,因?yàn)椴煌瑫?huì)員的欄目可能不一樣
通過(guò) space=$spaceid,只會(huì)顯示當(dāng)前會(huì)員的欄目,只是不清楚這個(gè)list能加catid參數(shù)不
{list action=model modelid=10 space=$spaceid num=10 order=updatetime}居然有catid這個(gè)參數(shù),我試試出來(lái)了,用兩層list循環(huán),第一層獲得catid,第二層指定catid
{list action=model modelid=1 space=$spaceid num=8 order=updatetime } {list action=model modelid=1 space=$spaceid num=8 order=updatetime catid=$t.catid} <li> <a href="{dr_space_show_url($spaceid, 1, $t.id)}">{dr_strcut($t.title, 40)}</a> </li> {/list} {/list}剩下的就交給html了把