用系統(tǒng)函數(shù)標(biāo)簽的欄目(頻道)總導(dǎo)航標(biāo)簽可以很方便的給生成的當(dāng)前欄目加上currclass,但有些情況,我們必須得用sql標(biāo)簽來實(shí)現(xiàn)的話,又苦于無法給當(dāng)前欄目加上currclass樣式
現(xiàn)提供實(shí)現(xiàn)方法:
打開ks_cls/kesion.label.sqlcls.asp
找到300多行,增加下面紅色的代碼即可
regEx.Pattern = "{\$Field\([^{\$}]*}"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(CirLabelContent)
TempStr=Replace(CirLabelContent,"{$AutoID}",N)
If Instr(tempstr,"{#GetItemUrl}")<>0 then tempstr=replace(tempstr,"{#GetItemUrl}",GetItemUrl(KS_RS_Obj))
If Instr(tempstr,"{#CurrClass}")<>0 then
if Split(KS.C_C(Fcls.RefreshFolderID,8)&",",",")(0)=KS_RS_Obj("id") or (UCase(FCls.RefreshType) = "INDEX" and N=1) then
tempstr=replace(tempstr,"{#CurrClass}"," class=""currclass""")
else
tempstr=replace(tempstr,"{#CurrClass}","")
end if
End If
For Each Match In Matches
使用方法:
在sql標(biāo)簽的循環(huán)體里加入{#CurrClass}標(biāo)簽。
如: