在针对织梦分页做SEO优化时,需要当前分页的标题中显示当前页数,以达到分页标题不一样的效果,织梦列表分页如何单独显示总页数跟当前页数呢?
织梦栏目列表页实现方法
打开 /include/arc.listview.class.php 找到 (大约在673行)
1
|
else if($PageNo!=1 && $ctag->GetName()=='field' && $ctag->GetAtt('display')!='')
|
在代码上方加入:
1
2 3 4 5 6 7 8 9 10 11 12 |
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 找到 (大概在542行)
1
|
else if($tagname=="field")
|
在其上面加入
1
2 3 4 5 6 7 8 9 10 11 12 |
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/}条数据
Pbootcms问题解决
请点击在线联系我们【点击咨询解决问题】 如果您有任何Pbootcms问题,我们将免费为您写解决教程!