帝国cms怎么在栏目列表页显示栏目的关键字词?

时间:2023年07月14日

/

来源:网络

/

编辑:佚名

帝国cms栏目的关键字词显示标签是[!--class.keywords--],但是如果要给这些关键字词分开,并且加上标签样式,应该怎么做呢?
下面是78模板网整理的关于栏目字词显示列表模板中的解决方案和思路,方便新手站长们在利用帝国cms建网站的时候,可以少走一些弯路。
方案一,直接显示关键字词,不用特殊处理
[!--class.keywords--]
如果我们用变量来显示关键字词,[!--class.keywords--],显示结果是:“帝国cms,帝国cms模板,帝国cms教程”。
方案二,按逗号分离字符串
<?php
$source = "帝国cms,帝国cms模板,帝国cms教程";//按逗号分离字符串
$hello = explode(',',$source);
for($index=0;$index<count($hello);$index++)
{
echo "<li>"; echo $hello[$index];echo "</li>";
}
?>
显示结果为:
<li>帝国cms</li><li>帝国cms模板</li><li>帝国cms教程</li>
方案三,链接同步tags标签
<?php
$cr=$empire->fetch1("select classpagekey from {$dbtbpre}enewsclass where classid='$GLOBALS[navclassid]'");
$source=$cr[classpagekey];
$hello = explode(',',$source);
for($index=0;$index<count($hello);$index++)
{
echo "<li><a href='/e/tags/?tagname=$hello[$index]&tempid=8'>"; echo $hello[$index];echo "</a></li>";
}
?>
如果没有建立标签,就需要到后台手动建立tags,然后系统自动匹配
以上就是关于帝国cms常见问题中"帝国cms怎么在栏目列表页显示栏目的关键字词?"的全部内容,如果有遇到帝国cms常见问题其他问题的,可以在评论留言,或者加微信咨询。
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。