muban大师 发表于 2021-8-10 09:43:52

织梦dede栏目的首字母作为栏目名称

在dede织梦模板后台调用织梦名称的时候,默认是使用栏目的全拼来作为栏目名称的,但是如果栏目很长的话,这样就会让栏目名称也变的很长,所以很多人都希望可以用拼音的首字母来作为栏目名称,修改一些文件也是可以实现的,但是记住要先保存数据。
       
        打开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);
                               
                       
               
       
       
       
        这样就可以了,然后更新一下就可以看到效果了。
页: [1]
查看完整版本: 织梦dede栏目的首字母作为栏目名称