帝国cms中上一页和下一页调用几种解决方法

2023-12-01 0 994

很多人都在使用帝国cms,其中在帝国cms内容页里会受到上一篇和下一篇这个问题困扰,今天我们就来解决下这个问题:1、帝国CMS自带模板变量:

上一篇:[!–info.pre–]下一篇:[!–info.next–]

缺点:[!–info.pre–] 和 [!–info.next–] 中封装的 <a>标签的内容无法定制2、灵动标签+SQL语句

[e:loop={"select * from [!db.pre!]ecms_news where id<'$navinfor[id]' and classid='$navinfor[classid]' order by id desc limit 1",1,24,0}]上一篇:<a href="<?=$bqsr[titleurl]?>" title="上一篇:<?=$bqr[title]?>" target="_blank"> ☜&nbsp; </a>[/e:loop][e:loop={"select * from [!db.pre!]ecms_news where id>'$navinfor[id]' and classid='$navinfor[classid]' order by id limit 1",1,24,0}]下一篇:<a href="<?=$bqsr[titleurl]?>" title="下一篇<?=$bqr[title]?>" target="_blank">☞</a>[/e:loop]

3、纯灵动标签

[e:loop={'selfinfo',1,0,0,'id<'.$navinfor[id].'','id desc'}]<a href="<?phpecho $bqsr[titleurl];$pre='true';?>">上一篇:<?=$bqr[title]?></a>[/e:loop]<?phpif(empty($pre)){echo "上一篇:很抱歉没有了";}?>[e:loop={'selfinfo',1,0,0,'id>'.$navinfor[id].'','id asc'}]<a href="<?phpecho $bqsr[titleurl];$next='true';?>">下一篇:<?=$bqr[title]?></a>[/e:loop]<?phpif(empty($next)){echo "下一篇:很抱歉没有了";}?>

4、动态调用

<a href="/e/public/GotoNext?classid=[!–self.classid–]&id=[!–id–]&enews=pre">上一篇文章</a><a href="/e/public/GotoNext?classid=[!–self.classid–]&id=[!–id–]&enews=next">下一篇文章</a>

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 帝国CMS教程 帝国cms中上一页和下一页调用几种解决方法 https://www.u-9.cn/jiaocheng/empirecms/13881.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务