功能說(shuō)明:用于獲取欄目列表 適用范圍:封面模板、列表模板、文檔模板 (1)基本語(yǔ)法 {dede:channel row='' type=''} 自定義樣式模板(InnerText) {/dede:channel} (2)屬性 [1] row='數(shù)字' 表示獲取記錄的條數(shù)(通用在某級(jí)欄目太多的時(shí)候使用,默認(rèn)是 8) [2] type= top,sun/son,self type='top' 表示頂級(jí)欄目 type='son' 或 'sun' 表示下級(jí)欄目 type='self' 表示同級(jí)欄目 其中后兩個(gè)屬性必須在列表模板中使用。 (3)底層模板變量 ID,typename,typedir,typelink(僅表示欄目的網(wǎng)址) 例: {dede:channel type='top'} <a href='[field:typelink /]'>[field:typename/]</a> {/dede:channel} 注:在沒(méi)有指定typeid的情況下,type標(biāo)記與模板的環(huán)境有關(guān),如,模板生成到欄目一,那么type='son'就表示欄目一的所有子類(lèi) 實(shí)例: {dede:channel typeid ='18' row='6' type='sun'} <a href="http://www.[field:typeurl/]" target="_blank">[field:typename/]</a>| {/dede:channel}
http://www./這個(gè)站首頁(yè)部分標(biāo)簽就是通過(guò)以上來(lái)完成的。
|