织梦后台提示用户名不存在 查看数据库用户名被改为spider
织梦仿站系列教程第二十三讲——列表页制作(二)
织梦仿站系列教程第二十三讲——列表页制作(二)
这一讲,我们讲下列表页的分页代码,先找到如下代码:
- 1
- href="http://www.quanji.cn/news/1/index_2.html">2
- href="http://www.quanji.cn/news/1/index_3.html">3
- href="http://www.quanji.cn/news/1/index_4.html">4
- href="http://www.quanji.cn/news/1/index_5.html">5
- href="http://www.quanji.cn/news/1/index_6.html">6
- href="http://www.quanji.cn/news/1/index_7.html">7
- href="http://www.quanji.cn/news/1/index_8.html">8
- href="http://www.quanji.cn/news/1/index_9.html">9
- href="http://www.quanji.cn/news/1/index_10.html">10
- href="http://www.quanji.cn/news/1/index_11.html">11
- href="http://www.quanji.cn/news/1/index_12.html">12
- href="http://www.quanji.cn/news/1/index_2.html">下一页
- href="http://www.quanji.cn/news/1/index_35.html">尾页
修改为织梦的列表分页代码:
-
- {dede:pagelist listitem="info,index,end,pre,next,pageno,option" listsize="5" /}
-
代码解释:
标签名称:pagelist
功能说明:表示分页页码列表
适用范围:仅列表模板 list_*.htm
基本语法:
- {dede:pagelist listsize='5' listitem=''/}
参数说明:
listsize 表示 [1][2][3] 这些项的长度 x 2
listitem 表示页码样式,可以把下面的值叠加
index 首页 pre 上一页 pageno 页码 next 下一页 end 末页 option 下拉跳转框
例:
- {dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="5"/}
查看前台:
看来页码是乱的,原因是织梦默认的列表页分页码自动生成
- 标签,有两种解决办法,一种是在织梦分页码前后加
- 标签。我们采用第二种,打开include目录下的文档arc.listview.class.php,将GetPageListST和GetPageListDM函数里的
- 标签删除。修改后我们再次查看前台:
显示正常,修改后的arc.listview.class.php下载