详情页

帝国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常见问题其他问题的,可以在评论留言,或者加微信咨询。
相关文章
猜你需要