织梦cms列表页和搜索页单独输出当前页码/总页码数/文档总数
- 作者: 九三网络
- 发表时间:2023-05-14 03:17:13
- 来源: 九三网络
列表页:
打开 /include/arc.listview.class.php 找到 else if($PageNo!=1 && $ctag->GetName()=='field' && $ctag->GetAtt('display')!='')
在它上面加入
else if($ctag->GetName()=="pageno") { $this->dtp->Assign($tagid,$this->PageNo); } else if($ctag->GetName()=="totalpage") { $this->dtp->Assign($tagid,ceil($this->TotalResult/$this->PageSize)); } else if($ctag->GetName()=="totalresult") { $this->dtp->Assign($tagid,$this->TotalResult); }
搜索页
打开 /include/arc.searchview.class.php 找到 else if($tagname=="field")
在它上面加入
else if($ctag->GetName()=="pageno") { $this->dtp->Assign($tagid,$this->PageNo); } else if($ctag->GetName()=="totalpage") { $this->dtp->Assign($tagid,ceil($this->TotalResult/$this->PageSize)); } else if($ctag->GetName()=="totalresult") { $this->dtp->Assign($tagid,$this->TotalResult); }
添加后记得保存哦!
栏目列表和搜索结果页模板文件统一调用标签写法:
当前第{dede:pageno/}页
共有{dede:totalpage/}页
共有{dede:totalresult/}篇文章
根据网页布局,自己添加上合适的css即可。