在
图集内容页调用图集的时候,如果使用某些幻灯片特效或者jquery插件,难免会用到ID编号什么的,本教程将教会你如何给图集图片自动编号,也就是说,让{dede:productimagelist}标签支持自动编号,***简单。
	 
	打开include/taglib/productimagelist.lib.php文件,找到:
	
		
			
				| 
$ctp->LoadSource($innerText);
 | 
		
	
	
	在其后面另起一行加入
	
		
			
				| 
$GLOBALS['autoindex'] = 0;
 | 
		
	
	
	找到:
	
		
			
				| 
$revalue .= $ctp->GetResult();
 | 
		
	
	
	在其后面另起一行加入
	
	
	这里的改动就算完了,接下来是内容页里调用:
	
		
			
				| 
[field:global name=autoindex/]
 | 
		
	
	
	例子:
	
		
			
				| 
{dede:productimagelist} <span id="[field:global name=autoindex/]"><img src="[field:imgsrc/]" width="805" height="523" /></span> {/dede:productimagelist}
 | 
		
	
	
	结果:
	
		
			
				| 
<span id="0"><img src="1.jpg" width="605" height="380" /></span>
<span id="1"><img src="2.jpg" width="605" height="380" /></span>
<span id="2"><img src="3.jpg" width="605" height="380" /></span>
 |