PBOOT知识


PbootCMS利用多条件搜索设资料查询功能

日期:2023.09.01 | 来源:本站 | 浏览:0

首页>>行业资讯>>PBOOT知识


PbootCMS想要实现多条件搜索要怎么操作呢?利用多条件搜索设资料查询功能!下面讲述一下主要操作设置。


简单搜索代码示例:

(只通过关键词进行搜索)

<form action="{pboot:scaction}" method="get">
    关键字:<input type="text" name="keyword" >
    <button type="submit">搜索</button>
</form>


多条件搜索代码示例:

可以通过隐藏字段,指定搜索的栏目

<form action="{pboot:scaction}"  method="get">    
    内容:<input type="text" name="content" >    
    标题:<input type="text" name="title" >    
    作者:<input type="text" name="author" >    
    <input type="hidden" name="scode" value="2,3" >    
    <button type="submit">搜索</button>    
</form>


通用搜索结果列表:

{pboot:search}
<a href="search:link">search:title</a>
{/pboot:search}


pbootcms实现全词匹配精确搜索或查询,可用于证书查询,授权查询一类的功能。

搜索页面模板标签如下:

{pboot:search field='title' fuzzy=0 scode=5}    
<a href="[search:link]">[search:title]</a>    
{/pboot:search}


field='title' 代表匹配标题

fuzzy=0 代表精确匹配

scode=5 代表只匹配栏目id为5的栏目文章


  >>>推荐类似信息如下: