网站搜索框默认存放在default/head.htm文件,怎么实现织梦站内搜索功能?根目录\plus\search.php控制cms搜索.
A.打开默认模版default/head.htm文件,将form表单部分的代码整体复制
<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>
B.或者直接将以下代码放入现在的default/head.htm搜索模块里面,进行修改.
<form id="search" name="search" method="post" action="/plus/search.php"> <input type="text" name="keyword" /> <input type="submit" value="" /> </form>
C:补充也有说是将templets/default/search.htm里面的form表单部分代码复制修改的.
<form> <input name="q" type="text" id="search-keyword" value="{dede:global name='keyword' function='RemoveXSS(@me)'/}" onfocus="if(this.value=='在这里搜索...'){this.value='';}" onblur="if(this.value==''){this.value='在这里搜索...';}" /> <select name="searchtype" id="search-option"> <option value="title" selected='1'>检索标题</option> <option value="titlekeyword">智能模糊</option> </select> <button type="submit" class="search-submit">搜索</button> <a href="heightsearch.php">高级搜索</a> </form>
转载请注明:大灰牛博客 » 织梦dedecms站内搜索功能怎么做