2013-03-11 58 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