织梦分类搜索结果页按栏目显示不同模板的方
网站建设 2022-07-27 09:12www.1681989.com免费网站
思路给搜索框加一个判定,例如搜索软件模型的时候显示一个模板,搜索文章模型的时候显示一个模板。 1、 在head区域加入 script language=javascript type=text/javascript ! function check(){ if(do […]
思路给搜索框加一个判定,例如搜索软件模型的时候显示一个模板,搜索文章模型的时候显示一个模板。
1、 在head区域加入
<script language="javascript" type="text/javascript">
<!–
function check(){
if(document.formsearch.channeltype.value=http://.xiaoxiangzi./="3")
document.formsearch.action="{dede:field name='PHPurl'/}/search_images.php"
else
document.formsearch.action="{dede:field name='phpurl'/}/search.php"
}
–>
</script>
2 、 更改搜索代码
<form name="formsearch" action="" ubmit="check();">
<div class="form">
<put type="hidden" name="kwtype" value=http://.xiaoxiangzi./"0" />
<put name="q" type="text" class="search-keyword" id="search-keyword" value=http://.xiaoxiangzi./"{dede:global name='keyword' function='RemoveXSS(@me)'/}" />
<select name="channeltype" id="channeltype" >
<option value='http://.xiaoxiangzi./1′ selected='1′>新闻</option>
<option value='http://.xiaoxiangzi./3′>软件</option>
</select>
<button type="submit" class="search-submit">搜索</button>
</div>
</form>
其中重点就是
<select name="channeltype" id="channeltype" >
<option value='http://.xiaoxiangzi./1′ selected='1′>新闻</option>
<option value='http://.xiaoxiangzi./3′>软件</option>
</select>
这里设置的按游戏模型搜索 1是文章模型3是软件模型
3 复制serach.php 更名为search_images.php
4 打开search_images.php
require_once(DEDEINC."/arc.searchview.class.php");
更改为
require_once(DEDEINC."/arc.searchimg.class.php");
5复制arc.searchview.class.php 更名为arc.searchimg.class.php
6 打开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_images.htm";
核心的修改已经结束了,剩下的就是在search_images.htm这个模板里自由发挥了。
同理也可以实现按栏目type搜索显示不同风格的结果页。
思路给搜索框加一个判定,例如搜索软件模型的时候显示一个模板,搜索文章模型的时候显示一个模板。
1、 在head区域加入
<script language="javascript" type="text/javascript">
<!–
function check(){
if(document.formsearch.channeltype.value=http://.xiaoxiangzi./="3")
document.formsearch.action="{dede:field name='PHPurl'/}/search_images.php"
else
document.formsearch.action="{dede:field name='phpurl'/}/search.php"
}
–>
</script>
2 、 更改搜索代码
<form name="formsearch" action="" ubmit="check();">
<div class="form">
<put type="hidden" name="kwtype" value=http://.xiaoxiangzi./"0" />
<put name="q" type="text" class="search-keyword" id="search-keyword" value=http://.xiaoxiangzi./"{dede:global name='keyword' function='RemoveXSS(@me)'/}" />
<select name="channeltype" id="channeltype" >
<option value='http://.xiaoxiangzi./1′ selected='1′>新闻</option>
<option value='http://.xiaoxiangzi./3′>软件</option>
</select>
<button type="submit" class="search-submit">搜索</button>
</div>
</form>
其中重点就是
<select name="channeltype" id="channeltype" >
<option value='http://.xiaoxiangzi./1′ selected='1′>新闻</option>
<option value='http://.xiaoxiangzi./3′>软件</option>
</select>
这里设置的按游戏模型搜索 1是文章模型3是软件模型
3 复制serach.php 更名为search_images.php
4 打开search_images.php
require_once(DEDEINC."/arc.searchview.class.php");
更改为
require_once(DEDEINC."/arc.searchimg.class.php");
5复制arc.searchview.class.php 更名为arc.searchimg.class.php
6 打开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_images.htm";
核心的修改已经结束了,剩下的就是在search_images.htm这个模板里自由发挥了。
同理也可以实现按栏目type搜索显示不同风格的结果页。
网站设计
- 静宁会SEO的网站建设公司:全面提升您的网络影
- 提升在线业务的关键:选择最佳的丽水网站建设
- 浙江网站优化发展潜力如何
- 井研专业的网站建设公司:打造您的在线品牌
- 灵山SEO网站建设公司:提升您的在线业务表现
- 蒙城网站建设优化公司:提升您网站表现的理想
- 阳谷企业网站优化:提升线上业务力的关键
- 樟树专业的网站建设公司:打造您在线业务的坚
- 通河百度SEO排名的策略与技巧
- 重庆百度快照排名如何进行精准的客户引流
- 重庆百度快照排名
- 常宁便宜的建站公司:助您轻松打造在线业务
- 巫溪百度网站优化:提升网站曝光率与流量的关
- 湖北整站优化怎么做才能放大客户需求
- 闸北网站建设多少钱?全面解析与预算规划
- 辽宁企业网站优化怎么做电话营销