欢迎光临
我们一直在努力

织梦cms:列表页显示条数不同的解决方法

找到网站根目录/include/ arc.listview.class.php

这里以列表首页显示6条,其他列表页显示9条为例,即 

模板页标签{dede:list pagesize="6"}{/dede:list} 

$this->PageSize = 6 

1.找到函数ParseDMFields 

找到

if($ctag->GetName()=="list") 
 { 
 $limitstart = ($this->PageNo-1) * $this->PageSize; 
 $row = $this->PageSize;

替换成

if($ctag->GetName()=="list") 
 { 
 $limitstart = ($this->PageNo-1) * $this->PageSize; 
 if($this->PageNo>2) 
{ 
 $limitstart = ($this->PageNo-1) * ($this->PageSize+3)-3; 
 } 
 $row = $this->PageSize; 
 if($this->PageNo>1) 
{ 
 $row = $this->PageSize+3; 
 }

在找到

$totalpage = ceil($this->TotalResult/$this->PageSize);//总共有两处分别为静态和动态

替换成

$totalpage = ceil(1+($this->TotalResult-$this->PageSize)/($this->PageSize+3));

未经允许不得转载:云站友 » 织梦cms:列表页显示条数不同的解决方法

评论 抢沙发

评论前必须登录!

立即登录   注册