在织梦的开发中,我们有时候需要对图集中的每张图片单独输出并自定义样式,如果用织梦的dede:productimagelist调用,还是有一定难度的。 下面我们可以对这个类文件进行修改解决这个问题: 方法1:找到:\include\taglib\productimagelist.lib.php 这个文件,在文件中找到如下内容: foreach($images as $row) { 中间省略... } 修改为: $GLOBALS['autoindex', = 1; foreach($images as $row) { $row['autoindex', = $GLOBALS['autoindex',; foreach($ctp->CTags as $tagid=>$ctag) { if($ctag->GetName()=='array') { $ctp->Assign($tagid,$row); } else { if(isset($row[$ctag->GetName()])){ $ctp->Assign($tagid,$row[$ctag->GetName()]); } } } $revalue .= $ctp->GetResult(); $GLOBALS['autoindex',++; } 内容页图集标签调用方法为: {dede:productimagelist} [field:array runphp=yes, if(@me['autoindex', == 1) { @me = "{@me['autoindex',} - [img]{@me[[/img] \n"; } elseif(@me['autoindex', == 2) { @me = "{@me['autoindex',} - [img]{@me[[/img] \n"; } elseif(@me['autoindex', == 3) { @me = "{@me['autoindex',} - [img]{@me[[/img] \n"; } else { @...
内容已隐藏,请关注公众号输入验证码查看
本帖支持关注公众号查看
【无套路 无套路 无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】
|