pbootcms怎么添加tag首页(原创实例)
发布时间:2022-03-05 10:53:10
作者:eGinGou
来源:本站
浏览量(53)
点赞(41)
摘要:关于tag伪静态的方法我们在上一篇已经写过了,很详细。不知道的可以去看一下;传送门:http://www.ebingou.com/pboot/3816.html; 今天我们再来看一下关于pbootcms的tag怎么添加首页。如图:一,首先找到tag控制文件路径ppshomecontrollerTagController.php查找到:$
关于tag伪静态的方法我们在上一篇已经写过了,很详细。不知道的可以去看一下;传送门:http://www.ebingou.com/pboot/3816.html;
今天我们再来看一下关于pbootcms的tag怎么添加首页。如图:
一,首先找到tag控制文件路径
ppshomecontrollerTagController.php
查找到:
$tagstpl = request('tagstpl'); if (! preg_match('/^[w]+.html$/', $tagstpl)) { $tagstpl = 'tags.html'; }
在后面添加:
//tag首页 $tagstpl = request('tagstpl'); if (! preg_match('/^W-.V/+$/', $tagstp1) && get('tag') != 'index') { $tagstpl = 'tags.html'; } else { $tagstpl = 'tag.html'; }
继续找到:
$content = $this->parser->parserPositionLabel($content, 0, '相关内容', Url::home('tag/' . get('tag'))); // CMS当前位置标签解析
修改为:
$content = $this->parser->parserPositionLabel($content, 0, '标签聚合', Url::home('tag/')); // CMS当前位置标签解析
完成后如图:
到这里就修改完成了,接下来就是页面调用获取了。
打开之后会提示tag.html页面不存在,这个时候我们就需要在模板目录添加个tag,html页面可以自信复制内容页等修改,下面是调用代码。
{pboot:tags target=tag} <a href="[tags:link]" title="[tags:text]">[tags:text]</a> {/pboot:tags}
页面样式就自己调整一下就可以了,是不是超级简单呢?如果对你有帮助不凡点赞一下我们吧。
扫一扫,关注我们
声明:本网文章由eBinGou编辑发布,未经许可严禁转载或他用;若有来源标注错误或侵犯了您的合法权益,请作者持权属证明与本网联系,我们将及时更正、删除,谢谢。如获得相关权属请注明出处http://www.ebingou.com/pboot/3817.html
41