VIP福利
主页 > 建站问题 > 织梦技巧 > 织梦CMS分栏目搜索不同栏目显示不同搜索结果

织梦CMS分栏目搜索不同栏目显示不同搜索结果

前台模板搜索框代码 加入下拉栏目选择typeid 打开 /include/arc.searchview.class.php 找到 $ tempfile = $GLOBALS [ cfg_basedir ]. $GLOBALS [ cfg_templets_dir ]. / . $GLOBALS [ cfg_df_style ]. /search.htm ; 在它下面加入 $ tempfile = ( $this -TypeID 0) ? str_replace( .htm , { $this -TypeI […]



前台模板搜索框代码

加入下拉栏目选择typeid

打开 /include/arc.searchview.class.php 找到

$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search.htm";

在它下面加入

$tempfile = ($this->TypeID > 0) ? str_replace(".htm","{$this->TypeID}.htm",$tempfile) : $tempfile;

完成。

这样修改后,有指定栏目的就按栏目id来调用搜索结果模板(search1.htmsearch2.htmsearch8.htm),没有指定栏目就是默认的search.htm
 


说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!