Dedecms织梦栏目URL使用拼音首字母做栏目名称的方法

文章摘要:我们在创建织梦网站栏目的时候,尤其在使用批量创建网站栏目或者默认自动创建栏目的时候,会自动获取织梦栏目名称的全拼作为URL路径,Dedecms织梦栏目URL使用拼音首字母做栏目名称的方法
我们在创建织梦网站栏目的时候,尤其在使用批量创建网站栏目或者默认自动创建栏目的时候,会自动获取织梦栏目名称的全拼作为URL路径,当遇到栏目名称比较长的时候目录名称看起来有点冗长,这时候大多数站长喜欢使用拼音首字母作为栏目的名称。
 
打开并进行修改dede/catalog.add.php文件
 
85行:$toptypedir = GetPinyin(stripslashes($toptypename));
 
修改为:$toptypedir = GetPinyin(stripslashes($toptypename),1);
 
 
 
108 行:$typedir = $toptypedir.'/'.GetPinyin(stripslashes($v));
 
修改为:$typedir = $toptypedir.'/'.GetPinyin(stripslashes($v),1);
 
 
 
134行:$toptypedir = GetPinyin(stripslashes($toptypename));
 
修改为:$toptypedir = GetPinyin(stripslashes($toptypename),1);
 
 
 
187行:$typedir = GetPinyin(stripslashes($typename));
 
修改为:$typedir = GetPinyin(stripslashes($typename),1);
 
 
 
注意事项
 
修改完成后赶快保存去试试吧,是不是很简单呢?作为首字母更加符合一些特殊用户的要求了。
  • 版权声明:本站原创文章,于2020-05-25 09:22,由 发表。
  • 转载请注明出处