-
金融理财投资类网站织梦...
-
天然绿色食品类网站织梦...
-
渔具批发牧渔类网站织梦...
-
手机APP游戏下载类网站织...
-
投资理财金融公司类网站...
-
节能环保锅炉设备类网站...
-
管理咨询培训机构类网站...
-
五金制品厨房用品类网站...
-
不秀钢材质钢管类网站织...
-
餐饮加盟培训管理类网站...
-
建筑规划施工类网站织梦...
-
建筑职业学校类网站织梦...
-
特色火锅餐饮加盟店网站...
-
中英双语装修建材类网站...
-
花店鲜花配送类网站织梦...
-
有机生物产品类网站织梦...
-
民宿景区旅游类网站织梦...
-
行业资讯网类网站织梦模...
-
装修设计类网站织梦模板...
-
语言翻译机构类网站织梦...
dedecms程序本身自带的模板有图片模型、文章模型、软件模型等,有时候为了用户体验需要给搜索框加一个判定,例如搜索软件模型的时候显示软件模型的模板,搜索文章模型的时候显示文章模型的模板。
具体的修改方法如下:
- 在head区域加入
<script language="javascript" type="text/javascript">function check(){if(document.formsearch.channeltype.value=="1")document.formsearch.action="{dede:field name='phpurl'/}/search.php"elsedocument.formsearch.action="{dede:field name='phpurl'/}/search_img.php"}</script>
- 更改搜索代码
<form name="formsearch" action="" data-ke-onsubmit="check();"><div class="form"><input type="hidden" name="kwtype" value="0" /><input name="q" type="text" class="search-keyword" id="search-keyword" value="{dede:global name='keyword' function='RemoveXSS(@me)'/}" /><select name="channeltype" id="channeltype" ><option value='1' selected='1'>新闻</option><option value='3'>软件</option></select><button type="submit" class="search-submit">搜索</button></div></form>
详解
value='1'和value='3'模型搜索1是文章模型,3是软件模型
复制serach.php更名为 search_img.php
打开search_img.php文件
找到
require_once(DEDEINC."/arc.searchview.class.php");
改为
require_once(DEDEINC."/arc.searchimg.class.php");
复制arc.searchview.class.php更名为arc.searchimg.class.php
打开 arc.searchimg.class.php文件
找到
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search.htm";
改为
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search_img.htm";