时间:2021-07-21人气:-
{dede:productimagelist}<a href="[field:imgsrc/]" title="[field:text/]"><img src="[field:imgsrc/]" width="120" height="90" /></a>{/dede:productimagelist}参数说明:无底层模板字段:imgsrc :图片路径text :文字描述注释:本标签可用于调用自定义字段类型为imgurls的字段。
$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.dede58.com" width="200" height="300" /></span>{/dede:productimagelist}
foreach($dtp->CTags as $ctag){if($ctag->GetName()=="img")修改为:
if(!isset($refObj->addTableRow['imgurls'])) return ;在此代码下边添加如下代码:
$aid = $refObj->ArcID;$row = $refObj->dsql->GetOne("SELECT title FROM `dede_archives` WHERE `id` = '$aid';");$title = $row['title'];找到(约41行):
$row['text'] = $ctag->GetAtt('text');在此代码下边添加如下代码:
$row['title'] = $title;调用代码:
[field:title/]示例:
{dede:productimagelist}<li><a href="javascript:ChangePic('[field:imgsrc/]', '#bigpicimg');" title="[field:text/]_www.dede58.com" rel="facebox"><img src="[field:imgsrc/]" width="120" height="90" alt="[field:title/]" /></a></li>{/dede:productimagelist}