muban大师 发表于 2020-3-2 09:11:53

Dedecms不修改数据库dedecms怎么实现中英栏目名

织梦dedecms不修改数据库dedecms怎么实现中英栏目名 ,首先找到\include\taglib\channel.lib.php 大约在第140行 。
       
        $likeType .= $linkOkstr;
       
        在这个之前加入
       
        $dirList = split('/',$row['typedir',);
        $dirName = array_pop($dirList);
        $linkOkstr = str_replace("~dirName~",$dirName,$linkOkstr);
       
        调用方法如下:
       
        {dede:channel type='top' row='10' currentstyle=''
        }
        [*,
          ,
                
                [field:typedir runphp='yes' commet="获得最后目录名,英文",
                    $l=split("/", @me);
                    @me=array_pop($l);
                [/field:typedir,
          
          
        {/dede:channel}
       
        这种方式的弊端是您的栏目链接要规范,按照英文的方式命名才可以。
页: [1]
查看完整版本: Dedecms不修改数据库dedecms怎么实现中英栏目名