专业网站设计、建设及维护
官方下载Pbootcms源码模板,安装后前台搜索受限,只搜索栏目编码为5中的内容。于是打开网站目录/template/default/html/search.php,发现第10行: {pboot:search num=12 order=sorting scode=5 field='title|content'} 中scode的值为5,将它增加更多栏目编码即可,用","号隔开,如:"scode=2,5,8"。
将代码:
<!-- 搜索-->
<form class="form-inline mb-2,5,8 justify-content-center" action="{pboot:scaction}" method="get">
<div class="form-group mx-sm-3 mb-2">
<input type="text" name="keyword" class="form-control" placeholder="请输入关键字">
</div>
<button type="submit" class="btn btn-info mb-2">搜索</button>
</form>
放到网站任何地方都可实现站内搜索。
24小时免费咨询
请输入您的联系电话,座机请加区号