本站资源均来自互联网,仅供学习与参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
Copyright @ 2015-2020 织梦园 版权所有
Power by DedeCms
鲁ICP备15039853号-1
鲁公网安备 37132302000249号
模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
在做DedeCMS织梦模板的时候一般都会给网站增加一个搜索的功能,但是在搜索的时候也会选择要搜索的栏目,是想搜索***新资讯,还是想在行业新闻中搜索,所以在网站中让搜索按照栏目分类搜素,这样能更准确的搜索到想要的结果。
在网站搜索中使用以下搜索代码:
<form action="{dede:field name='phpurl'/}/search.php" name="formsearch"> <div class="form"> <h4>搜索</h4> <input type="hidden" name="kwtype" value="0" /> <input type="hidden" name="searchtype" value="titlekeyword" /> <input name="keyword" type="text" class="search-keyword" id="search-keyword" /> <select name="typeid" class="search-option" id="typeid"> <option value='0' selected='1'>全部栏目</option> {dede:channelartlist typeid='top' } {dede:type} <option value='[field:id/]'>[field:typename/]</option>{/dede:type} {dede:channel type='son' noself='yes'} <option value='[field:id/]'>-[field:typename/]</option> {/dede:channel} {/dede:channelartlist} </select><button type="submit" class="search-submit">搜索</button> </div> </form> |