织梦CMS如何给图集图片自动编号{dede:productimagelist}标签

织梦CMS如何给图集图片自动编号{dede:productimagelist}标签

织梦dedeCMS图片集模板在内容页调用图集的时候,我们肯定会用到一些幻灯片特效或者jquery插件的,难免会用到ID编号什么的,CMS教程网教你如何给图集图片自动编号,让{dede:productimagelist}标签支持自动编号。
打开/include/taglib/productimagelist.lib.php文件

搜索代码:

$ctp->LoadSource($innerText);

在以上的代码下方插入:

$GLOBALS['autoindex'] = 0;

找到:

$revalue .= $ctp->GetResult();

搜索代码:

$GLOBALS['autoindex']++;

标签调用:

[field:global name=autoindex/]

调用代码:

{dede:productimagelist} 

   <span id="[field:global name=autoindex/]"><img src="[field:imgsrc/]" /></span> 

{/dede:productimagelist}

 

 

织梦CMS如何给图集图片自动编号{dede:productimagelist}标签

相关文章:

你感兴趣的文章:

标签云: