0

我正在尝试将其他参数添加到 tt_news img list source: data-src="path-to-img"。可能吗?我尝试使用通用标记但没有任何成功:

plugin.tt_news.genericmarkers {
  data = imgsource
  imgsource = TEXT
  imgsource {
    field = image
    wrap = <img src="uploads/pics/|" data-src="uploads/pics/|" />
    file.maxW = 112
    file.maxH = 124
  }
}

但是在输出中我只有这个源:<img src="uploads/pics/img.jpg" data-src="uploads/pics/没有第二个 img 源、img 大小和关闭标签。

有什么建议么?

4

1 回答 1

0

在我向您展示示例之前,请注意以下几点:

  • »wrap« 属性只允许一个管道(TYPO3 正在用当前值替换第一个 »|« 字符),这就是为什么你的第二个参数是空的
  • TEXT 对象仅允许在 »stdWrap« 部分中列出的值和所有属性(请参阅 TEXT 对象:http : //docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Text/Index.html,所有 stdWrap-properties http的列表://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Stdwrap/Index.html
  • 所以 TEXT 确实具有类似 »wrap« 或 »case« 或 »substring« 的属性,但没有 »file«
  • 你想要的是一个 IMAGE 对象,它允许操作图像

    plugin.tt_news.genericmarkers {
        imgsource = IMAGE
        imgsource {
            file.import = uploads/pics/
            file.import.field = image
            file.import.listNum = 0
            file.width = 250
            # if you just want to link the original image
            params.field = image
            params.wrap = data-src="/uploads/pics/|"
            /*
            # if you want want to manipulate the image as well, then use this code instead
            # IMG_RESOURCE is almost the same as IMAGE, but returns only the path to the resulting image, not the »<img src="">«-Markup
            params.cObject = IMG_RESOURCE
            params.cObject {
                file.import = uploads/pics/
                file.import.field = image
                file.import.listNum = 0
                file.width = 500
                stdWrap.wrap = data-src="|"
            }
            */
        }
    }
    
于 2014-08-14T09:18:26.053 回答