欢迎来到元素模板ys720.com,本站提供专业的织梦模板PBOOTCMS模板网站模板网站修改/网站仿站
当前位置:主页 > 程序教程 > 帝国cms教程 >
帝国cms教程

帝国CMS 如何使用灵动标签调用相关文章

(元素模板) / 2023-02-19 20:04

帝国cms如何使用灵动标签来调用相关文章,元素模板为您解答:
标题包含关键字
①、比较粗糙的匹配,可能不太精确:title like ‘%$navinfor[keyboard]%’
②、精确的匹配,比较消耗资源:title regexp ‘(^|,)$navinfor[keyboard]($|,)’

关键字相同
①、比较粗糙的匹配,可能不太精确:keyboard like ‘%$navinfor[keyboard]%’
②、精确的匹配,比较消耗资源:keyboard regexp ‘(^|,)$navinfor[keyboard]($|,)’

格式1、
①、模糊匹配

[e:loop={"select * from phome_ecms_news where title like '%$navinfor[keyboard]%' or keyboard like '%$navinfor[keyboard]%' order by id desc limit 10",0,24,0}]
[/e:loop]

②、精确的匹配

[e:loop={"select * from phome_ecms_news where title regexp '(^|,)$navinfor[keyboard]($|,)' or keyboard regexp '(^|,)$navinfor[keyboard]($|,)' order by id desc limit 10",0,24,0}]
[/e:loop]

格式2、
①、模糊匹配

[e:loop={'news',10,3,0,"keyboard like '%$navinfor[keyboard]%' or title like '%$navinfor[keyboard]%'",''}]
[/e:loop]

[e:loop={0,10,3,0,"keyboard like '%$navinfor[keyboard]%' or title like '%$navinfor[keyboard]%'",''}]
[/e:loop]

注意:在没有相关文章时,会调用最新的文章来替代空缺的位置

Copyright @ 2013-2021 元素模板 www.ys720.com All Rights Reserved. 版权所有 元素模板 www.ys720.com