---
title: "织梦(dedecms)仿站教程第二十三讲——列表页制作（二）"
author: "piperzero"
date: "2013-02-21T12:41:00Z"
tags: []
slug: "dedecms"
draft: false
lastmod: "2013-02-21T19:54:48Z"
id: 1811660
url: "https://piperzero.iteye.com/blog/1811660"
---

这一讲，我们讲下列表页的分页代码，先找到如下代码：

01. &lt;DIV class=pages&gt;&lt;A title="Total record"&gt; &lt;B&gt;865&lt;/B&gt;
02. &lt;/A&gt; &lt;B&gt;1&lt;/B&gt; &lt;A
03. href="http://www.quanji.cn/news/1/index\_2.html"&gt;2&lt;/A&gt; &lt;A
04. href="http://www.quanji.cn/news/1/index\_3.html"&gt;3&lt;/A&gt; &lt;A
05. href="http://www.quanji.cn/news/1/index\_4.html"&gt;4&lt;/A&gt; &lt;A
06. href="http://www.quanji.cn/news/1/index\_5.html"&gt;5&lt;/A&gt; &lt;A
07. href="http://www.quanji.cn/news/1/index\_6.html"&gt;6&lt;/A&gt; &lt;A
08. href="http://www.quanji.cn/news/1/index\_7.html"&gt;7&lt;/A&gt; &lt;A
09. href="http://www.quanji.cn/news/1/index\_8.html"&gt;8&lt;/A&gt; &lt;A
10. href="http://www.quanji.cn/news/1/index\_9.html"&gt;9&lt;/A&gt; &lt;A
11. href="http://www.quanji.cn/news/1/index\_10.html"&gt;10&lt;/A&gt; &lt;A
12. href="http://www.quanji.cn/news/1/index\_11.html"&gt;11&lt;/A&gt; &lt;A
13. href="http://www.quanji.cn/news/1/index\_12.html"&gt;12&lt;/A&gt; &lt;A
14. href="http://www.quanji.cn/news/1/index\_2.html"&gt;下一页&lt;/A&gt; &lt;A
15. href="http://www.quanji.cn/news/1/index\_35.html"&gt;尾页&lt;/A&gt;&lt;/DIV&gt;

修改为织梦的列表分页代码：

&lt;DIV class=pages&gt;

{dede:pagelist listitem="info,index,end,pre,next,pageno,option" listsize="5" /}

&lt;/DIV&gt;

代码解释：

标签名称：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"/}

原文来自dedecms教程：http://www.software8.co/wzjs/dedecms/2779.html

查看前台：

![](http://www.software8.co/uploads/allimg/130120/0K24Q049-0.jpg)

看来页码是乱的，原因是织梦默认的列表页分页码自动生成&lt;li&gt;&lt;/li&gt;标签，有两种解决办法，一种是在织梦分页码前后加&lt;ul&gt;&lt;/ul&gt;标签，然后修改样式；一种是修改PHP文档，去掉&lt;li&gt;&lt;/li&gt;标签。我们采用第二种，打开include目录下的文档arc.listview.class.php，将GetPageListST和GetPageListDM函数里的&lt;li&gt;&lt;/li&gt;标签删除。修改后我们再次查看前台：

![](http://www.software8.co/uploads/allimg/130120/0K24V3B-1.jpg)