我遇到了挑战,自从现在一天起就无法找到解决方案。
renderObj = COA
renderObj {
10 = TEXT
10 {
cObjNum = 1
field = image
split {
token = ,
cObjNum = |*| 10 || 20 |*|
10.current = 1
10.wrap = <li><a href="#"><img ref="uploads/pics/|" src=
20.current = 1
20.wrap = "uploads/pics/|" /></a><span>{CAPTION-GOES-HERE}</span></li>
}
}
}
如您所见,我分割图像,首先是jQuery对象“ref”,第二个是预览图像。现在我需要获取两个图像中的一个的标题,无关紧要。
我对能得到的每一个小提示都非常高兴。
非常感谢!
答案 0 :(得分:1)
没有测试过,但我想这应该可以做到。
renderObj = COA
renderObj {
10 = TEXT
10 {
field = image
split {
token = ,
cObjNum = 1
1.current = 1
1 {
10 = TEXT
10.value = <img ref="uploads/pics/{current:1}" src="uploads/pics/{current:1}" />
10.insertData = 1
10.wrap = <a href="#">|</a>
20 = TEXT
20.field = field_name_where_your_captions_are
20.listNum.data = REGISTER:SPLIT_COUNT
20.wrap = <span>|</span>
wrap = <li>|</li>
}
}
}
}
答案 1 :(得分:0)
当我尝试将其划分为逻辑结构并使用IMG_RESOURCE
对象时,它会更长一点,即使它们在您的情况下不是必需的(尽管如果您想对这些图像进行某些处理,则需要它)未来的)。
renderObj = COA
renderObj {
wrap = <li>|</li>
10 = COA
10 {
wrap = <a href="#"><img|/></a>
10 = IMG_RESOURCE
10 {
file {
import = uploads/pics/
import.field = image
import.listNum = 0
}
stdWrap.noTrimWrap = | ref="|"
}
20 = IMG_RESOURCE
20 {
file {
import = uploads/pics/
import.field = image
import.listNum = 1
}
stdWrap.noTrimWrap = | src="|" |
}
}
20 = TEXT
20 {
field = imagecaption
listNum = 0
listNum.splitChar = 10
wrap = <span>|</span>
}
}