引用網(wǎng)友的話:
欄目導(dǎo)航我要這樣的(希望出一個(gè)豎向欄目導(dǎo)航,可自動(dòng)識(shí)別所屬頂級(jí)欄目)
上午在論壇看到網(wǎng)友需要這種效果,這種導(dǎo)航也比較常用到,借此機(jī)會(huì),順便說(shuō)一下如何做這種效果,希望對(duì)大家有所幫助...
首先,我是分兩個(gè)SQL標(biāo)簽去實(shí)現(xiàn)的,一個(gè)是內(nèi)層的(調(diào)用二級(jí)欄目),一個(gè)是外層的(調(diào)用一級(jí)欄目),
先建一個(gè)內(nèi)層的SQL標(biāo)簽:
定義名稱(chēng)為"欄目?jī)?nèi)循環(huán)"
查詢(xún)語(yǔ)句:select top 50 id,foldername from ks_class where tn='{$Param(0)}' order by folderorder
循環(huán)體:
[loop=20]
<li><a href="{$Field(id,GetInfoUrl,100,1)}">{$Field(foldername,Text,0,...,0,)}</a></li>
[/loop]
根據(jù)網(wǎng)站需要,控制[loop=多少]
再看外層sql標(biāo)簽:
如定義名稱(chēng)為:外欄目
查詢(xún)語(yǔ)句:
select top 50 id,foldername from ks_class where tj=1 and topflag=1 and channelid=5 order by folderorder
備注:channelid=5 是指調(diào)用商城系統(tǒng)下的
循環(huán)體:
<style>
.n li{height:25px;border:1px solid #DDE3FB}
.n ul{margin:0px;padding:0px}
</style>
[loop=50]
<div style="background:#DDE3FB;height:25px;line-height:25px"><strong><a href="{$Field(id,GetInfoUrl,100,1)}">{$Field(foldername,Text,0,...,0,)}</a></strong></div>
<div class="n">
<ul>
{SQL_欄目?jī)?nèi)循環(huán)({$Field(id,GetInfoUrl,100,2)})}
</ul>
</div>
[/loop]
好了,接下來(lái)把這個(gè)標(biāo)簽{SQL_外欄目()}插入到模板中要顯示這個(gè)效果的位置保存模板.