我需要从特定的colPos渲染styles.content.get中的记录。
记录由temp.recordcontent提供
记录应该分开。因此我使用拆分。
我的问题是我要分开单个记录的标题和正文文本。
我的Typoscript:
temp.generateSlider = COA
temp.generateSlider {
10 < temp.recordcontent
stdWrap.split {
token = ###SPLITTER###
cObjNum = |*| 1 || 2 |*|
1 = COA
1 {
5 = [something]
10 = [header of the current record]
15 = [something]
20 = [bodytext of the current record]
25 = [something]
}
2 = COA
2 {
5 = [something else]
10 = [header of the current record]
15 = [something else]
20 = [bodytext of the current record]
25 = [something else]
}
}
}
当我在下面添加代码时,我将获得整个记录,但我怎样才能获得标题(或bodytext)?
10 = TEXT
10.data = current:1
我尝试了类似下面的内容,但这不起作用
10.field = header
答案 0 :(得分:0)
我通过渲染RECORD对象(temp.recordcontent)中的元素并将它们包装在拆分中来解决问题。
记录
temp.recordcontent = RECORD
temp.recordcontent{
tables = tt_content
dontCheckPid = 1
source.cObject < temp.getuids
conf.tt_content.stdWrap.wrap = |###SPLITTER###
conf.tt_content = COA
conf.tt_content {
20 = TEXT
20.field = header
20.wrap = <h2 class="blue"> | </h2>
30 = TEXT
30.field = bodytext
30.wrap = <p>|</p>
}
}
分割
temp.generateRibbonrow = COA
temp.generateRibbonrow {
10 < temp.recordcontent
stdWrap.split {
token = ###SPLITTER###
cObjNum = |*| 1 || 2 |*| 3
1 = COA
1 {
10 = TEXT
10.value = <div class="myclass">
20 = TEXT
20.data = current:1
}
2 .....
3 = COA
3{
10 = TEXT
10{
if.isTrue.prioriCalc=1
if.isTrue.cObject=TEXT
if.isTrue.cObject.insertData=1
if.isTrue.cObject.value={register:SPLIT_COUNT}%2
value(
<div class="ym-g50"><div class="ym-gbox"></div></div>
</div>
)
}
}
}
}
现在我可以获取特定colPos的记录,并且可以在其自己的小小的带状框中呈现每个元素:)