2013-03-11 43 views
6

我('M)S(t)的UCK; - )TYPO3 6.0:渲染从边境列当前页面的图像FAL

我已经有以下片断,我不明白这一点的工作。

COL3 = FILES 
COL3 { 
     references { 
      table = tt_content 
      uid = 14 
      fieldName = image 
     } 
     renderObj = TEXT 
     renderObj { 
      data = file:current:publicUrl 
      wrap = <img src="|"> 
     } 
} 

片段工作,到目前为止,但我想与当前页面使用& colPos = 3,因此,像:

table = tt_content 
select { 
    where = colPos = 3 
    orderBy = sorting 
    languageField = sys_language_uid 
} 

这种感觉就像我已经试过几乎所有的东西。

我真的很感激每一个帮助,我可以得到...

谢谢你的很多!

回答

4

我认为select属性不适用于references
试试这个解决方案(未经测试)与任何内容元素一起使用。

... 
references { 
    table = tt_content 
    uid.data = uid 
    fieldName = image 
} 

另一个想法:

COL3 = CONTENT 
COL3 { 
    table = tt_content 
    select { 
     where = colPos = 3 
    } 

    renderObj = FILES 
    renderObj { 
      references { 
       table = tt_content 
       fieldName = image 
      } 
      renderObj = TEXT 
      renderObj { 
       data = file:current:publicUrl 
       wrap = <img src="|"> 
      } 
     } 
    } 
+1

你救了我的天!非常感谢。我已经干了第一个已经不适合我的工具 - 但第二个工具是可以开箱的!谢了哥们。 – lufi 2013-03-12 06:21:48

+0

太好了 - 我没有测试,这让我更加pr :) :)。 – Mateng 2013-03-12 08:46:43

7

这听起来更好的对我说:

COL3 = CONTENT 
COL3 { 
    table = tt_content 
    select { 
     where = colPos = 3 
    } 

    renderObj = FILES 
    renderObj { 
      references { 
       table = tt_content 
       fieldName = image 
      } 
      renderObj = IMAGE 
      renderObj { 
       file.import.data = file:current:publicUrl 
      } 
     } 
    } 
+0

这确实是更好的解决方案,因为它为图片使用了IMAGE对象。 – lorenz 2013-10-09 11:59:24