PbootCMS想要實(shí)現(xiàn)多條件搜索要怎么操作呢?
簡單搜索代碼示例:
(只通過關(guān)鍵詞進(jìn)行搜索)
<form action="{pboot:scaction}" method="get">
關(guān)鍵字:<input type="text" name="keyword" >
<button type="submit">搜索</button>
</form>
多條件搜索代碼示例:
可以通過隱藏字段,指定搜索的欄目
<form action="{pboot:scaction}" method="get"> 內(nèi)容:<input type="text" name="content" > 標(biāo)題:<input type="text" name="title" > 作者:<input type="text" name="author" > <input type="hidden" name="scode" value="2,3" > <button type="submit">搜索</button> </form> |
通用搜索結(jié)果列表:
{pboot:search}
<a href="search:link">search:title</a>
{/pboot:search}
pbootcms實(shí)現(xiàn)全詞匹配精確搜索或查詢,可用于證書查詢,授權(quán)查詢一類的功能。
搜索頁面模板標(biāo)簽如下:
{pboot:search field='title' fuzzy=0 scode=5} <a href="[search:link]">[search:title]</a> {/pboot:search} |
field='title'代表匹配標(biāo)題
fuzzy=0代表精確匹配
scode=5代表只匹配欄目id為5的欄目文章