我們在制作織夢模板時,源代碼中的[field:global name=autoindex/]標簽很好用可以調用數字序號,此標簽最簡單的用法就是按內容條數來獲取數字序號,但有的時候發現使用該標簽時無效比如頻道頁。
channelartlist標簽下可以使用
{dede:global name=’itemindex’/}
dede:channel標簽下直接使用
[field:global name=autoindex/]
dede:channel標簽當前樣式currentstyle下時,需要修改文件
打開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標簽下使用
~autoindex~