首页进行模块内容分页显示,用到的标签是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}

文档最后更新时间:2022-06-21 08:45:34
我来修改此文档(2) 不会操作怎么办?