我有一个页面,我在其中输出某些记录(而不是页面)中的预告片。我已经通过下面的打字稿意识到了这一点。该脚本通过流畅的脚本获取参数:
<f:for each="{data.tx_mask_cnt_nwsdat_teaser_rec}" as="data_item">
<f:cObject typoscriptObjectPath="lib.dateteaser-man-x" data="{uid: data_item.uid, recid: data_item.records}"/>
</f:for>
变量“ recid”包含记录中的ID,应从中生成预告片。这可以按预期的方式工作-记录将按照ID在“ recid”中的顺序进行排序,但是现在我想按“ tx_mask_cnt_textpic_uni_date”字段对记录进行排序-我该如何实现?
lib.dateteaser-man-x {
wrap = |
10 = RECORDS
10 {
source.data = field:recid // --> comma separated list of record-ids
dontCheckPid = 1
tables = tt_content
conf.tt_content = COA
conf.tt_content {
wrap = <div class="teaserbox-item-wrapper">|</div>
# Datum / Symbol
10 = CASE
10 {
key.field = tx_mask_cnt_textpic_uni_teaserlabel
1 = COA
1 {
wrap = <div class="tb-labelfield">|</div>
10 = TEXT
10 {
wrap = <span class="tb-date day">|</span>
field = tx_mask_cnt_textpic_uni_date // --> field to sort by (format YYY-MM-DD)
strtotime = 1
strftime = %e
}
20 = TEXT
20 {
wrap = <span class="tb-date monthyear">|</span>
field = tx_mask_cnt_textpic_uni_date
strtotime = 1
strftime = %b. %y
}
}
2 = TEXT
2 {
wrap = <div class="tb-labelfield">|</div>
value = <span class="tb-info"><i data-feather="info"></i></span>
}
default = TEXT
default {
wrap = <div class="tb-labelfield">|</div>
value = <span class="tb-info"><i data-feather="info"></i></span>
}
}
# Text
30 = TEXT
30 {
wrap = <div class="tb-content">|</div>
field = tx_mask_cnt_textpic_uni_teasertxt
}
}
}
}
在此先感谢您的帮助!
Typo3 V.9.5.8
答案 0 :(得分:0)
在这种情况下,您应该使用CONTENT
而不是RECORDS
https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/ContentObjects/Content/Index.html
CONTENT
使用了select
,这又会给您uidInList
和orderBy
https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Functions/Select.html#select