織夢DEDECMS的搜索功能一直有很多的不足之處,而如今百度站內搜索已全面開放。相比DEDECMS的搜索功能,百度站內搜索更具優勢!下面,aspku就教大家如何將織夢默認搜索改為百度站內搜索,此教程基于DEDECMS默認模板制作,其他模板請自行根據教程修改,方法大體類似。
打開:templets/default/目錄下的head2.htm和head.htm,找到其中的:
<form name="formsearch" action="{dede:global.cfg_cmsurl/}/plus/search.php">
<div class="form">
<h4>搜索</h4>
<input type="hidden" name="kwtype" value="0" />
<input name="q" type="text" class="search-keyword" id="search-keyword" value="在這里搜索..." onfocus="if(this.value=='在這里搜索...'){this.value='';}" onblur="if(this.value==''){this.value='在這里搜索...';}" />
<select name="searchtype" class="search-option" id="search-option">
<option value="title" selected='1'>檢索標題</option>
<option value="titlekeyword">智能模糊</option>
</select>
<button type="submit" class="search-submit">搜索</button>
</div>
</form>
修改為:
<form name="formsearch"
action="http://www.bcty365.com.com/cse/search">
<div class="form">
<h4>搜索</h4>
<input type="hidden" name="s" value="3527383009548599228">
<input type="hidden" name="ie" value="gbk">
<input name="q" type="text" class="search-keyword" id="search-keyword" value="在這里搜索..." onfocus="if(this.value=='在這里搜索...'){this.value='';}" onblur="if(this.value==''){this.value='在這里搜索...';}" />
<button type="submit" class="search-submit">搜索</button>
</div>
</form>
其中,紅色部分為新增。 <input type="hidden" name="s" value="3527383009548599228"> value值為搜索引擎ID,登陸百度站內搜索中可查看。
此文由 網站目錄_網站網址收錄與提交入口 編輯,未經允許不得轉載!: