dedecms

修改dedecms文章标题 加入当前栏目名称

版本:dedecms 5.5
原效果:文章标题_网站名称
修改后:文章标题_2级栏目_1级栏目_网站名称
修改文件:
直接修改模版文章,把标题替换为:
{dede:field name=’title’/}_{dede:field name=’position’ runphp=’yes’}
$tc=”_”; //分隔符
$tw=$GLOBALS['cfg_list_symbol']; //调用位置分隔符
@me=html2text(@me); //去除html标签
$tf=split($tw,@me); //分解成数组
for($ta=(count($tf)-2);$ta>=1;$ta–){ //循环赋值给$tk
$tk.=trim($tf[$ta]).$tc;
}
$tk=substr($tk,0,-1);
@me=$tk; //赋值给@me
{/dede:field}_{dede:global name=’cfg_webname’/}

Tagged: 标签:

Leave A Comment?