Typoscript从tt_content获取图像和标题

时间:2013-12-13 13:41:36

标签: typo3 typoscript

我试图从tt_content元素中获取图像URL以及标题。 到目前为止,我能够获取图像的URL,但我仍然坚持获取标题或与该图像相关的其他内容。

目标是从另一个页面上的随机tt_content元素(UID:181)获取图像和标题并显示它们。

这是我到目前为止所得到的:

Block.Test = COA
Block.Test {
  10 = CONTENT
  10 {
    table = tt_content
    select {
    pidInList = 181
      max = 1
      orderBy = RAND()

    }
    renderObj = COA
    renderObj {
      10 = TEXT
      10 {
        field = image
      }
      20 = TEXT
      20 {
        field = title
      }
    }
  }

提前致谢!

1 个答案:

答案 0 :(得分:0)

如果安装了6.2,可以这样做:

renderObj = 10
renderObj {
    10 = FILES
    10 {
      references {
        table = tt_content
        fieldName = image
        uid.data = uid
      }
      renderObj = IMAGE
      renderObj {
        file.import.data = file:current:originalUid // file:current:uid
      }
    }
    20 = TEXT
    20 {
      field = title
    }
  }

它也适用于TYPO3 7.6。

相关问题