0

嗯......我的TypoScript技能似乎變得有點生疏。TypoScript:有條件地包裝,如果多個項目

lib.feld < styles.content.get 
lib.feld.select.orderBy = rand() 
lib.feld.select.select.where = colPos=11 
lib.feld.wrap = <div class="wrapper">|</div> 

我想補充包裝格比說colPos一個項目只有styles.content.get回報更多。

我試過以下兩個變種:

lib.feld.wrap.if { 
    isGreaterThan.numRows < styles.content.get 
    isGreaterThan.numRows.select.where = colPos=11 
    value = 1 
} 

lib.feld.wrap.if { 
    isGreaterThan.numRows.table = tt_content 
    isGreaterThan.numRows.select < styles.content.get.select 
    isGreaterThan.numRows.select.where = colPos=11 
    value = 1 
} 

也有附加stdWrap前numRows行。 即使應該有多個結果,一切都會返回false。

出了什麼問題?

回答

1

從Typo腳本定義我猜想:

temp.feld < styles.content.get 
temp.feld.select.where = colPos=11 
temp.feld.select.orderBy = rand() 
temp.feld.select.pidInList = 123 

lib.feld < temp.feld 
lib.feld.wrap = <div>|</div> 
lib.feld.wrap.if { 
    isGreaterThan.stdWrap.numRows < temp.feld 
    value = 1 
} 

用於檢測/ debuggung您可以使用此的numRows值:

lib.numRows = TEXT 
lib.numRows.numRows < temp.feld 
lib.numRows.wrap = numRows=[|] 

,您可以在使用流體

{f:cObject(typoscriptObjectPath:'lib.numRows')} 

或typoscript本身輸出

page.3 < lib.numRows 
+0

它產生一個錯誤,但我可以添加'isGreaterThan.stdWrap.numRows.table = tt_content'並且錯誤消失了。不過,我還沒有得到它的工作。我也在這個問題上忘了一行。現在編輯它 – Urs

+0

你是對的:我忘了桌子。我改變了我的例子來複制完整的CONTENT對象,儘管只有表格和選擇是必要的 –

+0

如果您不確定渲染的typoscript值是否嘗試打印它。我會在我的答案中添加一個部分。 –