Copyright @ 2015-2024 织梦园 版权所有 Power by DedeCms
鲁ICP备15039853号-2

模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
为dedecms文章分页标题加上序号,小编提醒:本教程只在dedecms5.1版本下测试通过,如果您想在其它版本试验,请先备份原文件!
改模板文件inc_archives_view.php就OK了
代码如下:
| 
//循环生成HTML文件
else
{
for($i=1;$i<=$this->TotalPage;$i++)
{
$tempTitle=$this->Fields['title'];//临时存储一个标题副本
if($i>1)
{
$truefilename = $this->GetTruePath().$fileFirst."_".$i.".".$this->ShortName; 
//为分页标题加上序号。2009.2.13
$this->Fields['title'] = $this->Fields['title'].'('.$i.')';//在标题后面多加个序号 
}
else
{
$truefilename = $this->GetTruePath().$filename;
}
$this->ParseDMFields($i,1);
$this->dtp->SaveTo($truefilename);
$this->Fields['title']=$tempTitle;//生成html,还原标题
}
} | 
列表页的标题也有办法了
| 
<title>{dede:field.title/}_第{dede:pagelist listsize='0' listitem='pageno' function='html2text(@me)'/}页</title> | 
用{dede:pagelist listsize='0' listitem='pageno' function='html2text(@me)'/}可以调用第几页那个数字。。哈哈
***了
改模板文件list_article.htm就OK了