"景先生毕设|www.jxszl.com

织梦dedecms图集图片每张自定义輸出不同样式

2022-10-29 16:28编辑: www.jxszl.com景先生毕设
如果你的图集图片要在内容页按不同的html输出每I.张图片,出了CSS+js能实现,我们也可以用arrayrunphp的方式来让每I.张自定义输出

效果



修改教程

include aglibproductimagelis

 更多精彩就在: 51免费论文网|www.jxszl.com 
t.lib.php找到

foreach($imagesas$row)

{

中间省略...

}

改成


$GLOBALS[autoindex]=I.;foreach($imagesas$row){$row[autoindex]=$GLOBALS[autoindex];foreach($ctp->CTagsas$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:arrayrunphp=yes]if(@me[autoindex]==I.){@me="{@me[autoindex]}- ";}elseif(@me[autoindex]==II){@me="

{@me[autoindex]}-

";}elseif(@me[autoindex]==III){@me="{@me[autoindex]}- ";}else{@me="
{@me[autoindex]}-
";}[/field:array]{/dede:productimagelist}


复杂I.点的写法

{dede:productimagelist}[field:arrayrunphp=yes]if(@me[autoindex]==II){@me="
";}else{@me="";}[/field:array]{/dede:productimagelist}{dede:productimagelist}[field:arrayrunphp=yes]if(@me[autoindex]==III){@me="
";}elseif(@me[autoindex]==IV){@me="
";}else{@me="";}[/field:array]{/dede:productimagelist}


原文链接:http://www.jxszl.com/biancheng/dedecms/75228.html
最新推荐
热门阅读
随机阅读