演示链接:查看演示

dedecmsdede栏目的首字母作为栏目名称

在dedededecmsCMS模板后台调用dedecmsCMS名称的时候,默认是使用栏目的全拼来作为栏目名称的,但是如果栏目很长的话,这样就会让栏目名称也变的很长,所以很多人都希望可以用拼音的首字母来作为栏目名称,修改一些文件也是可以实现的,但是记住要先保存数据。
 

打开dede/catalog.add.php文件
 

找到

$toptypedir = GetPinyin(stripslashes($toptypename));

 

修改为 

$toptypedir = GetPinyin(stripslashes($toptypename),1);

 

找到

$typedir = $toptypedir.'/'.GetPinyin(stripslashes($v));

 

修改为 

$typedir = $toptypedir.'/'.GetPinyin(stripslashes($v),1);

 

找到

$toptypedir = GetPinyin(stripslashes($toptypename));

 

修改为 

$toptypedir = GetPinyin(stripslashes($toptypename),1);

 

找到

$typedir = GetPinyin(stripslashes($typename));

 

修改为 

$typedir = GetPinyin(stripslashes($typename),1);

 

这样就可以了,然后更新一下就可以看到效果了。

THE END
喜欢就支持一下吧
点赞0 分享