运营狗 - 图集自增 https://blog.seo135.com/tag/%E5%9B%BE%E9%9B%86%E8%87%AA%E5%A2%9E/ zh-CN Sat, 15 Jun 2019 14:46:00 +0800 Sat, 15 Jun 2019 14:46:00 +0800 织梦DedeCMS图集调用添加图片数字编号自增 https://blog.seo135.com/555.html https://blog.seo135.com/555.html Sat, 15 Jun 2019 14:46:00 +0800 运营狗 织梦DedeCMS图集调用标签为 {dede:field name='imgurls' alt='图片输出区'}
[field:imgsrc/]
{/dede:field}
,其中 [field:global.autoindex/] 和其他递增标签在图集中调用是没有作用,下面是实现图集图片数字递增的方法。

前台效果

织梦DedeCMS

前端代码

图集调用添加图片数字编号自增

实现方法

打开 /include/taglib/productimagelist.lib.php 文件 找到

$ctp->LoadSource($innerText);

在它下面加入

$GLOBALS['autoindex'] = 0;

继续找到

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

在它下面加入

$GLOBALS['autoindex']++;

完成。

]]>
1 https://blog.seo135.com/555.html#comments https://blog.seo135.com/feed/tag/%E5%9B%BE%E9%9B%86%E8%87%AA%E5%A2%9E/