首页分页显示模块内容

2024-01-26 15:31 小编

首页进行模块内容分页显示,用到的标签是module,

{module module=news page=1 pagesize=10 urlrule=/index.php?page=[page]}


{$t.title}

{/module}


{$pages}

这是很标准的写法,循环news模块内容列表,每页显示10条内容,下页地址格式是:index.php?page=2。


========伪静态模式=========

绝大部分站点下页都会才有伪静态的模式,例如下页格式为:/page-2.html的写法:

{module module=news page=1 pagesize=10 urlrule=/page-[page].html}


{$t.title}

{/module}


{$pages}

这时候访问下页会出现404现象,需要手动写上解析规则,config/rewrite.php:

"page\-([0-9]+)\.html(.*)"  => 'index.php?c=home&m=index&page=$1',

{xunruicms_img_title}


在线咨询 拨打电话

电话

13363039260

内部绝密传真282期

微信二维码