織夢在搜索結(jié)果頁添加按欄目按模型細(xì)分?jǐn)?shù)據(jù),不修改程序文件,直接在模板文件里實現(xiàn),
search.htm 搜索結(jié)果頁按欄目細(xì)分標(biāo)簽寫法
<a href="{dede:global.cfg_cmspath/}/plus/search.php?pagesize=10&q={dede:global name='keyword' function='RemoveXSS(@me)'/}">全部</a>
<a href="{dede:geturl runphp=yes}$a = array("/&typeid=(\d+)/i","/&PageNo=(\d+)/i","/&TotalResult=(\d+)/i");$b = array("","","");@me = preg_replace($a,$b,GetCurUrl());{/dede:geturl}&typeid=1">新聞中心</a>
<a href="{dede:geturl runphp=yes}$a = array("/&typeid=(\d+)/i","/&PageNo=(\d+)/i","/&TotalResult=(\d+)/i");$b = array("","","");@me = preg_replace($a,$b,GetCurUrl());{/dede:geturl}&typeid=6">產(chǎn)品中心</a>
注意上面 typeid 就是按欄目id
search.htm 搜索結(jié)果頁按內(nèi)容模型細(xì)分標(biāo)簽寫法
<a href="{dede:global.cfg_cmspath/}/plus/search.php?pagesize=10&q={dede:global name='keyword' function='RemoveXSS(@me)'/}">全部</a>
<a href="{dede:geturl runphp=yes}$a = array("/&channeltype=(\d+)/i","/&PageNo=(\d+)/i","/&TotalResult=(\d+)/i");$b = array("","","");@me = preg_replace($a,$b,GetCurUrl());{/dede:geturl}&channeltype=1">文章模型</a>
<a href="{dede:geturl runphp=yes}$a = array("/&channeltype=(\d+)/i","/&PageNo=(\d+)/i","/&TotalResult=(\d+)/i");$b = array("","","");@me = preg_replace($a,$b,GetCurUrl());{/dede:geturl}&channeltype=2">圖集模型</a>
注意上面 channeltype 就是按模型id。
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 織夢在搜索結(jié)果頁添加按欄目按模型細(xì)分?jǐn)?shù)據(jù)