织梦列表分页单独显示总页数跟当前页数

在针对织梦分页做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/}条数据

本站不保证所提供下载的资源的准确性、安全性和完整性,资源仅供下载学习之用!请勿直接商用。网站资源来自用户分享,如有侵权行为请联系网站客服处理。
二月繁华 » 织梦列表分页单独显示总页数跟当前页数