1

我遇到了挑战,从现在开始就找不到解决方案。

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”,第二个是 Preview-Image。现在我需要得到两个图像之一的标题,不管哪个。

我真的很高兴我能得到的每一个小提示。

非常感谢!

4

2 回答 2

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>
            }
        }
    }
}
于 2012-08-20T07:20:54.657 回答
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>
  }
}
于 2012-08-17T14:57:50.260 回答