N級子欄目調用上級欄目名稱和鏈接
{dede:field name='position' runphp='yes'}
$tc="-"; //分隔符
$tw=$GLOBALS['cfg_list_symbol']; //調用位置分隔符
$tf=split($tw,@me); //分解成數組
$ta=(count($tf)-3);
$tk=trim($tf[$ta]);
@me=$tk; //賦值給@me
{/dede:field}
{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'/}
將以上代碼放在<title></title>之間就可以實現“文章標題-2級欄目-1級欄目-網站名”的形式了
新聞熱點
疑難解答