首页 小组 问答 话题 好文 素材 用户 唠叨 我的社区

[分享]PbootCMS内容页上一篇下一篇“没有了!”怎么修改?

风轻yLv.1种子选手
2024-09-13 18:06:07
0
46

PbootCMS内容页上一篇下一篇样式怎么修改,一些内容页差异化样式,需要对上一篇下一篇的样式做更改,要怎么操作呢?
1、首先遇到做英文站,碰到内容页,没有的时候输出为没有了,但是我们需要这块做成英文,要怎么弄呢?
这个我们其实只需要用{content:nexttitle notext='no more'} 设置“没有了”文本,就可以实现,这样没有文档时候会输出 no more.
2、如果需要对上一篇,下一篇样式做个性化修改要怎么操作呢?

就比如我只需要在内容页输出为上一篇、下一篇,怎么操作?这时候我们需要找到\apps\home\controller\ParserController.php 这个文件,找到如下代码:

$content = str_replace($search, '<a href="' . $this->parserLink($pre->type, $pre->urlname, 'content', $pre->scode, $pre->sortfilename, $pre->id, $pre->filename) . '">' . $this->adjustLabelData($params, $pre->title) . '</a>', $content);

改为:

$content = str_replace($search, '<a href="' . $this->parserLink($pre->type, $pre->urlname, 'content', $pre->scode, $pre->sortfilename, $pre->id, $pre->filename) . '">上一条</a>', $content);

在这段下面有个“没有了”的样式,需要改下,加个A标签(注意,这个地方有多个相同代码,就改这段下面就行)

$content = str_replace($search, '没有了!', $content);

改为:

$content = str_replace($search, '<a>没有了!</a>', $content);

继续往下面:

$content = str_replace($search, '<a href="' . $this->parserLink($next->type, $next->urlname, 'content', $next->scode, $next->sortfilename, $next->id, $next->filename) . '">' . $this->adjustLabelData($params, $next->title) . '</a>', $content);

改为:

$content = str_replace($search, '<a href="' . $this->parserLink($next->type, $next->urlname, 'content', $next->scode, $next->sortfilename, $next->id, $next->filename) . '">下一条</a>', $content);

在这段下面有个“没有了”的样式,需要改下,加个A标签(注意,这个地方有多个相同代码,就改这段下面就行)

 $content = str_replace($search, '没有了!', $content);

改为:

$content = str_replace($search, '<a>没有了!</a>', $content);
风轻y
风轻y

39 天前

签名 :   46       0
评论
站长交流