最新提示:經(jīng)用戶本站測(cè)試,以下方法經(jīng)測(cè)試得不到正常標(biāo)簽結(jié)果,請(qǐng)謹(jǐn)慎使用!以后有正確的方法將會(huì)及時(shí)更新!
最近武林網(wǎng)小編再查織夢(mèng)dedecms標(biāo)簽的問題,碰巧搜到下面這篇內(nèi)容了,感覺有用,就先留下。
弄了半天終于知道如何讓織夢(mèng)DEDECMS的TAG標(biāo)簽按欄目顯示,只顯示當(dāng)前欄目的所有標(biāo)簽:D
一、打開include/taglib/目錄下的 tag.lib.php 文件
找到下面這段代碼,并在中間插入標(biāo)注部分代碼
<span style="font-size:14px;"><span style="font-family:tahoma,geneva,sans-serif;">if($getall==0 && isset($refObj->Fields['tags']) && !empty($refObj->Fields['aid'])) { $dsql->SetQuery("Select tid From `ddmx_taglist` where aid = '{$refObj->Fields['aid']}' "); $dsql->Execute(); $ids = ''; while($row = $dsql->GetArray()) { $ids .= ( $ids=='' ? $row['tid'] : ','.$row['tid'] ); } if($ids != '') { $addsql = " where id in($ids) "; } if($addsql=='') return ''; } else if($getall==2) { $addsql = " where typeid='{$refObj->Fields['typeid']}' "; } else { if(!empty($typeid)) { $addsql = " where typeid='$typeid' "; } </span></span>二、修改你的模板
模板調(diào)用如下:
<span style="font-size:14px;"><span style="font-family:tahoma,geneva,sans-serif;">{dede:tag sort='hot' getall='2'}<a href='[field:link/]'>[field:tag /]</a>{/dede:tag} </span></span>搞定。
以上就是織夢(mèng)/dedecms TAG標(biāo)簽按欄目顯示(只顯示當(dāng)前欄目標(biāo)簽)的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)和解決疑問有所幫助,也希望大家多多支持武林網(wǎng)。新聞熱點(diǎn)
疑難解答
圖片精選