我們?cè)谥谱?a href="http://www.j4240.cn/">織夢(mèng)模板時(shí),源代碼中的[field:global name=autoindex/]標(biāo)簽很好用可以調(diào)用數(shù)字序號(hào),此標(biāo)簽最簡(jiǎn)單的用法就是按內(nèi)容條數(shù)來(lái)獲取數(shù)字序號(hào),但有的時(shí)候發(fā)現(xiàn)使用該標(biāo)簽時(shí)無(wú)效比如頻道頁(yè)。
channelartlist標(biāo)簽下可以使用
{dede:global name=’itemindex’/}
dede:channel標(biāo)簽下直接使用
[field:global name=autoindex/]
dede:channel標(biāo)簽當(dāng)前樣式currentstyle下時(shí),需要修改文件
打開channel.lib.php文件
找到
$linkOkstr = $currentstyle; 
$row['typelink'] = GetOneTypeUrlA($row); 
$linkOkstr = str_replace(“~rel~”,$row['rel'],$linkOkstr); 
$linkOkstr = str_replace(“~id~”,$row['id'],$linkOkstr); 
$linkOkstr = str_replace(“~typelink~”,$row['typelink'],$linkOkstr); 
$linkOkstr = str_replace(“~typename~”,$row['typename'],$linkOkstr); 
在它下面加上 
$linkOkstr = str_replace(“~autoindex~”,$GLOBALS['autoindex']+1,$linkOkstr);
currentstyle標(biāo)簽下使用
~autoindex~