织梦搜索结果页添加按栏目按模型细分搜索数据方法效果:
织梦在搜索结果页添加按栏目按模型细分数据,不修改程序文件,直接在模板文件里实现
search.htm 搜索结果页按栏目细分标签写法
<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">产品中心</a>
注意上面 typeid 就是按栏目id
search.htm 搜索结果页按内容模型细分标签写法
<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
织梦二次开发QQ群
本站客服QQ号:862782808(点击左边QQ号交流),群号(383578617) 如果您有任何织梦问题,请把问题发到群里,阁主将为您写解决教程!
转载请注明: 织梦模板 » 织梦搜索结果页添加按栏目按模型细分搜索数据方法