雷火电竞-中国电竞赛事及体育赛事平台

歡迎來(lái)到入門(mén)教程網(wǎng)!

dedecms

當(dāng)前位置:主頁(yè) > CMS教程 > dedecms >

織夢(mèng)/dedecms TAG標(biāo)簽按欄目顯示(只顯示當(dāng)前欄目標(biāo)簽)

來(lái)源:本站原創(chuàng)|時(shí)間:2021-08-05|欄目:dedecms|點(diǎn)擊:

最新提示:經(jīng)用戶(hù)本站測(cè)試,以下方法經(jīng)測(cè)試得不到正常標(biāo)簽結(jié)果,請(qǐng)謹(jǐn)慎使用!以后有正確的方法將會(huì)及時(shí)更新!
最近AB織夢(mèng)模板網(wǎng)小編再查織夢(mèng)dedecms標(biāo)簽的問(wèn)題,碰巧搜到下面這篇內(nèi)容了,感覺(jué)有用,就先留下。
弄了半天終于知道如何讓織夢(mèng)DEDECMS的TAG標(biāo)簽按欄目顯示,只顯示當(dāng)前欄目的所有標(biāo)簽:D
一、打開(kāi)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)提示“body has not allow words!”問(wèn)題解決

欄    目:dedecms

下一篇:dedecms織夢(mèng)的循環(huán)次數(shù)的方法并做條件判斷

本文標(biāo)題:織夢(mèng)/dedecms TAG標(biāo)簽按欄目顯示(只顯示當(dāng)前欄目標(biāo)簽)

本文地址:http://www.jygsgssxh.com/a1/dedecms/15636.html

更多dedecms

您可能感興趣的文章

閱讀排行

本欄相關(guān)

隨機(jī)閱讀

網(wǎng)頁(yè)制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語(yǔ)言數(shù)據(jù)庫(kù)服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有