关">

当前位置:首页>站长学院>PbootCms教程

PbootCMS多条件搜索教程,用于查询

来源:www.abcmuban.com 发布时间:2023-05-05热度:14 ℃

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的栏目文章

转载请注明来源网址:https://www.abcmuban.com/pbootcmsjc/297.html

如果你的问题还没有解决,点击PBootCMS建站交流群加入交流群一起学习交流。支持与鼓励站长,请扫码赞赏

  • 微信支付

    微信扫一扫

  • 支付宝支付

    支付宝扫一扫

推荐模板
交流学习

加入VIP即可下载全部模板;2天更新1套模板

年VIP:199元(金牌)

终身VIP:299元(钻石)

  • QQ号

    Q:2935517386

  • 添加微信客服

    微信客服

  • QQ号

    Q群:817597747

热门标签
 
Q:2935517386