全站搜索时,想要搜索几个指定栏目的内容应该怎么设置;下边是现在用的
<form class="search-form" action="/index.php" method="get">
<input type="hidden" name="c" value="api">
<input type="hidden" name="m" value="search">
<input type="hidden" name="dir" id="dr_search_module_dir" >
<div class="input-group-btn btn-group" style="display: none;">
<button id="dr_search_module_name" type="button" class="btn default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu">
<!--这是来列出全部可以搜索的内容模块-->
{php $top_search=[];}
{list action=cache name=module}
{if !$t.setting.search.close}
{php !$top_search && $top_search=$t;}
<li><a target="_blank" href="[removed]dr_search_module_select('{$t.dirname}', '{$t.name}');"> {$t.name} </a></li>
{/if}
{/list}
</ul>
</div>
<input type="text" name="keyword" value="请输入关键词" class="s_w" onblur="if (this.value ==''){this.value=this.defaultValue}"
onclick="if(this.value=='请输入关键词')this.value=''" />
<input type="submit" name="submit" value="" class='an' style="border:0; padding: 0;" />
<script>
// 这段js是用来执行搜索的
function dr_search_module_select(dir, name) {
$("#dr_search_module_dir").val(dir);
$("#dr_search_module_name").html(name+' <i class="fa fa-angle-down"></i>');
}
dr_search_module_select('{php echo defined('MOD_DIR') ? MOD_DIR : $top_search.dirname}', '{php echo defined('MODULE_NAME') ? MODULE_NAME : $top_search.name}');
</script>
</form>