用织梦DedeCMS系统建网站,有时会需要在子栏目显示上级栏目名称和栏目链接,就用到下面的代码了。
N级子栏目调用最上级栏目名称和链接
{dede:field name='position' runphp='yes'}
$tc="-"; //分隔符
$tw=$GLOBALS['cfg_list_symbol']; //调用位置分隔符
$tf=split($tw,@me); //分解成数组
$ta=1;
$tk=trim($tf[$ta]);
$tk=substr($tk,0,-2);
@me=$tk; //赋值给@me