織夢(mèng)dedecms怎樣設(shè)置不同的搜索頁模板,織夢(mèng)技術(shù)
導(dǎo)讀:織夢(mèng)技術(shù)織夢(mèng)技術(shù)織夢(mèng)的搜索功能很好用,但有時(shí)候我們會(huì)需要一些特殊的搜索情況,例如我們網(wǎng)站中需要根據(jù)頻道不同,調(diào)用不同的搜索結(jié)果頁模板。本文就來教大家怎樣調(diào)用不同的搜索頁模板。 dede手機(jī)模板。
織夢(mèng)的搜索功能很好用,但有時(shí)候我們會(huì)需要一些特殊的搜索情況,例如我們網(wǎng)站中需要根據(jù)頻道不同,調(diào)用不同的搜索結(jié)果頁模板。本文就來教大家怎樣調(diào)用不同的搜索頁模板。dedecms本身自帶的模板有圖片模型、文章模型、軟件模型等,有時(shí)候?yàn)榱擞脩趔w驗(yàn)需要給搜索框加一個(gè)判定,例如搜索軟件模型的時(shí)候顯示軟件模型的模板,搜索文章模型的時(shí)候顯示文章模型的模板。
具體的dede商城模板實(shí)現(xiàn)代碼如下:
1.在head區(qū)域加入如下代碼:
<script language="javascript" type="text/javascript">
function check(){
if(document.formsearch.channeltype.value=="1")
document.formsearch.action="{dede:field name='phpurl'/}/search.php"
else
document.formsearch.action="{dede:field name='phpurl'/}/search_news.php"}
</script>
這段代碼主要用來判斷你選擇了什么頻道,根據(jù)你選擇的頻道的不同,來使用不同的搜索頁模板。
2.更改搜索代碼
<form name="formsearch" action="" data-ke-onsubmit="check();">
<div class="form">
<input type="hidden" name="kwtype" valu夢(mèng)織模板e(cuò)="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 valu織夢(mèng)手機(jī)模板e(cuò)='3'>軟件</option>
</select>
<button type="submit" class="search-submit">搜索</button>
</div>
</form>
其中重點(diǎn)就是
<select name="channeltype" id="channeltype" >
<option value='1' selected='1'>新聞</option>
<option value='3'>軟件</option>
</select>
關(guān)鍵設(shè)置:這里設(shè)置的按模型搜索 1是文章模型 3是軟件模型
3.復(fù)制/plus/serach.php 更名為 /plus/search_images.php
4.打開 search_images.php將如下代碼:
require_once(DEDEINC."/arc.searchview.class.php");
更改為
require_once(DEDEINC."/arc.searchimg.class.php");
5.復(fù)制 /include/arc.searchview.class.php 更名為 /include/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
做完上面的操作,基本就可以調(diào)用出不同的搜索頁模板了。祝你成功。相關(guān)dede手機(jī)模板。
聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-18 ,文章織夢(mèng)dedecms怎樣設(shè)置不同的搜索頁模板,織夢(mèng)技術(shù)主要講述模板,不同,織夢(mèng)網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請(qǐng)保留鏈接: http://www.bifwcx.com/article/web_29440.html
為你推薦與織夢(mèng)dedecms怎樣設(shè)置不同的搜索頁模板,織夢(mèng)技術(shù)相關(guān)的文章
-
通王TWCMS 2.0.3網(wǎng)站模板程序下載
(126)人喜歡 2024-01-15 -
Windows官方原版在哪里下載
(175)人喜歡 2024-01-15 -
WordPress網(wǎng)站模板發(fā)帖標(biāo)題顏色設(shè)置
(131)人喜歡 2024-01-07 -
修改discuz論壇帖子標(biāo)題80字符的長(zhǎng)度限制
(249)人喜歡 2024-01-07 -
wordpress程序調(diào)用不帶超鏈接的Tag標(biāo)簽
(234)人喜歡 2024-01-05 -
網(wǎng)站在不同時(shí)期需調(diào)整內(nèi)容更新的方向
(112)人喜歡 2023-08-12