添加搜索框代码如下:
<form method="post"
action="{dede:global.cfg_basehost/}/plus/search.php" name="formsearch"
class="search"><input type="hidden" value="www.dedecms.com" name="domains"><input type="hidden" value="0" name="kwtype">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
散穗和 <tr>
<td width="65"></td>
<td width="146" valign="middle"><input class="keywords" name="q" type="text" id="search" value="请输入搜索内容...">
<input type="hidden" value="titlekeyword" name="searchtype" >
</td>
<td width="5"></td>
<td><button type="submit" class="submit"></button></td>
族陆 </tr>
冲盯 </table>
</form>
二、
<form method="post" action="{dede:global.cfg_basehost/}/plus/search.php" name="formsearch" class="search"><input type="hidden" value="www.dedecms.com" name="domains"><input type="hidden" value="0" name="kwtype">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="65">&nbsp</td>
<td width="146" valign="middle">
<input class="keywords" name="q" type="text" id="search" value="请输入搜索内容..." onFocus="if(this.value=='请输入搜索内容...'){this.value=''}" onBlur="if(this.value==''){this.value='请输入搜索内容...'}">
<input type="hidden" value="titlekeyword" name="searchtype" >
</td>
<td width="5">&nbsp</td>
<td> <button type="submit" class="submit"></button> </td>
</tr>
</table>
</form>
搜索框代码,放到模板里,通常放头部模板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>
还需要有搜索结果展示模好腔板,进templets/default里找到search.htm复制到你的新模板目录。
这样就可以搜索了。
模板的具体样式自己调整下,或者参照这个默认的search.htm里的标签自己做个模板。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)