Warning: Undefined array key "night" in /www/wwwroot/dhaomu.com/wp-content/themes/b2/header.php on line 18

织梦教程给productimagelist图集标签添加数字编号自增递增的方法

dedecms教程织梦给productimagelist图集标签添加数字编号自增递增的方法!织梦教程给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/]" alt="www.adminbuy.cn" width="200" height="300" /></span>
{/dede:productimagelist}

输出html代码:

<span id="0"><img src="1.jpg" alt="www.dhaomu.com" width="200" height="300" /></span>
<span id="1"><img src="2.jpg" alt="www.dhaomu.com" width="200" height="300" /></span>
<span id="2"><img src="3.jpg" alt="www.dhaomu.com" width="200" height="300" /></span>
温馨提示:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:duhaomu@163.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA赞赏
共{{data.count}}人
人已赞赏
编程技巧

织梦教程首页调用指定一篇文章body内容的教程

2023-7-5 0:00:00

编程技巧

WordPress主题模板调用wordpress内置自带jquery库的代码方法

2023-7-24 0:00:00

0 条回复 A文章作者 M管理员

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索