聯(lián)系官方銷售客服
1835022288
028-61286886
請(qǐng)問搜索頁面如何定義第二個(gè)模板文件?
因?yàn)槲易隽酥杏⑽陌姹?,現(xiàn)在中英文版本都是用同一個(gè)搜索代碼,那在英文頁面,搜索結(jié)果就會(huì)跳到中文頁面
所以想問怎么修改下面這段代碼,讓我可以使用第search_en.html的這個(gè)模板文件? 默認(rèn)會(huì)使用search.html
<form class="search" 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="ipt-txt"> <button id="dr_search_module_name" type="button" data-toggle="dropdown" aria-expanded="false" style="display: none"> </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> --> <input type="text" placeholder="請(qǐng)輸入您要搜索的關(guān)鍵詞" name="keyword" class="fc-search-keyword form-control"> </div> <button type="submit" name="" class="btn-submit"> 搜 索 </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>
中英文站推薦使用多網(wǎng)站插件,就不會(huì)出現(xiàn)這個(gè)情況了
1樓正解~多語言網(wǎng)站必備
如果實(shí)在不想買 多網(wǎng)站插件,,那就英文版單獨(dú)創(chuàng)建欄目,欄目設(shè)置中設(shè)置不一樣的模板。