網(wǎng)站建設(shè)過程中,用織夢dede:channelartlist調(diào)用排除指定typeid欄目,官方?jīng)]有默認這個功能,需要做一些二次修改開發(fā)。
下面直接講方法:對其他沒有影響,新手可以直接修改。
打開 \include\taglib\channelartlist.lib.php 文件
找到
$attlist = 'typeid|0,row|20,cacheid|';
修改為:
// 此處添加了一個所要排除typeid的參數(shù)—notypeid
$attlist = 'typeid|0,row|20,cacheid|,notypeid|0';
找到
$dsql>SetQuery("Selectid,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath from `dede_arctype` where $tpsql order by sortrank asc limit $totalnum");
在其前面添加
//否定指定ID
if($notypeid!=0) {
$tpsql = $tpsql."and not(id in($notypeid)) ";
}
模板調(diào)用:
{dede:channelartlist typeid ='top' notypeid='1'}
其中notypeid=’1′ 中的 1為 top(或者指定某欄目)的子欄目即生效。
以上就是關(guān)于【織夢dede:channelartlist排除欄目調(diào)用方法】的文章內(nèi)容,如果您還想了解更多關(guān)于網(wǎng)站建設(shè)與網(wǎng)絡(luò)推廣的相關(guān)文章,請繼續(xù)查看【織夢教程】欄目的其它文章
來源www.dashustudio.net廣州明行威,致力于中小企業(yè)網(wǎng)絡(luò)營銷推廣、整體外包運營(網(wǎng)站建設(shè)、SEM、SEO等)、企業(yè)SEO內(nèi)訓(xùn)、信息流廣告運營
歡迎交流 加微信13430336474 廣州張楷

上一篇:織夢如何解決當(dāng)前位置position中英文翻譯問題 下一篇:織夢網(wǎng)站優(yōu)化頁面怎么實現(xiàn)隨機調(diào)用文章