迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費(fèi)且不限制商業(yè)使用,是免費(fèi)開源的產(chǎn)品,以萬端互聯(lián)為設(shè)計理念,支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
怎么做全站搜索呢,不想要模板那樣的選擇內(nèi)容模型那樣,直接全站搜索,代碼怎么寫
還有,按照模板文件寫的,在單頁搜索是出現(xiàn)APP目錄不存在: APPSPATH/Share/ 這個錯誤的,如果要內(nèi)容模型,這個怎么改
<form class="search-form" action="/index.php" method="get">
<input type="hidden" name="s" value="api">
<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">
<div class="input-group-btn btn-group">
<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">
<!--這是來列出全部可以搜索的內(nèi)容模塊-->
{php $top_search=[];}
{cache name=module-content}
{if $t.search}
{php !$top_search && $top_search=$t;}
<li><a href="javascript:dr_search_module_select('{$t.dirname}', '{$t.name}');"> {$t.name} </a></li>
{/if}
{/cache}
</ul>
</div>
<input type="text" placeholder="搜索內(nèi)容..." name="keyword" class="fc-search-keyword form-control">
<div class="input-group-btn">
<button class="btn default" type="submit"> <i class="fa fa-search"></i> </button>
<script>
// 這段js是用來執(zhí)行搜索的
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('MOD_DIR') ? MODULE_NAME : $top_search.name}');
</script>
</form>
這是最初的搜索表單,應(yīng)該怎么改呢
默認(rèn)模板有木有這個問題???
回復(fù)@胡金海
這就是默認(rèn)模板的問題
你不要內(nèi)容模塊你去搜索哪個???搜索是依賴內(nèi)容模塊的
回復(fù)@坤哥
按關(guān)鍵詞全站搜索可以嗎,一定要加上內(nèi)容模塊嗎,可以隱藏掉吧,但是隱藏掉后就無法選擇模塊了
這個問題怎么解決呢
求幫忙
一樣的問題
有全站搜索插件
你全站只使用一個模塊,不就全站搜索了咯
全站都只用news 模塊,那么這個問題就很容易解決了。
官方全站搜索插件需要設(shè)置三步:偽靜態(tài)設(shè)置,這樣設(shè)置好了是第一步
第二步是修改rewrite.php
// 全模塊搜索分頁"so-(.+).html" => "so/home/index/rewrite/$1",// 全模塊搜索"so.html" => "so/home/index",
第三步就是上傳代碼,和搜索框代碼了,可以直接用下面這個;會跳轉(zhuǎn)到solist.html
<> </> </> </> <> <> <><><></> </> </> </>
<form class="search-form" action="/index.php" method="get">
<input type="hidden" name="s" value="api">
<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">
<div class="input-group-btn btn-group">
<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">
<!--這是來列出全部可以搜索的內(nèi)容模塊-->
{php $top_search=[];}
{cache name=module-content}
{if $t.search}
{php !$top_search && $top_search=$t;}
<li><a href="javascript:dr_search_module_select('{$t.dirname}', '{$t.name}');"> {$t.name} </a></li>
{/if}
{/cache}
</ul>
</div>
<input type="text" placeholder="搜索內(nèi)容..." name="keyword" class="fc-search-keyword form-control">
<div class="input-group-btn">
<button class="btn default" type="submit"> <i class="fa fa-search"></i> </button>
</div>
</div>
<script>
// 這段js是用來執(zhí)行搜索的
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('MOD_DIR') ? MODULE_NAME : $top_search.name}');
</script>
</form>
這是最初的搜索表單,應(yīng)該怎么改呢
默認(rèn)模板有木有這個問題???
回復(fù)@胡金海
這就是默認(rèn)模板的問題
你不要內(nèi)容模塊你去搜索哪個???搜索是依賴內(nèi)容模塊的
回復(fù)@坤哥
按關(guān)鍵詞全站搜索可以嗎,一定要加上內(nèi)容模塊嗎,可以隱藏掉吧,但是隱藏掉后就無法選擇模塊了
這個問題怎么解決呢
求幫忙
一樣的問題
有全站搜索插件
你全站只使用一個模塊,不就全站搜索了咯
全站都只用news 模塊,那么這個問題就很容易解決了。
官方全站搜索插件需要設(shè)置三步:偽靜態(tài)設(shè)置,這樣設(shè)置好了是第一步
第二步是修改rewrite.php
第三步就是上傳代碼,和搜索框代碼了,可以直接用下面這個;會跳轉(zhuǎn)到solist.html