如何让DatabaseQueryProcessor像在后端字段(字段“页面”的存储的逗号分隔列表)中对记录进行排序一样?
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
table = pages
pidInList = 1
recursive = 99
where {
data = field:pages
wrap = nav_hide=0 AND uid IN (|)
}
as = pages
}
答案 0 :(得分:0)
尝试以下未经测试的样品:
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
table = pages
pidInList = 1
recursive = 99
where = TEXT
where {
data = field:pages
wrap = nav_hide=0 AND uid IN (|)
}
order = TEXT
order.stdWrap {
field = pages
split {
token = ,
cObjNum = 1|*|2
1.current = 1
1.trim = 1
1.noTrimWrap = |uid=||
2.current = 1
2.trim = 1
2.noTrimWrap = |, uid=||
}
}
as = pages
}
基本上,我创建以下order by
语句(让我们使用1,2,3
作为uid样本):
Order By uid=1, uid=2, uid=3
我使用splite印刷功能,用逗号吐出uid列表,然后使用cObjNum
用配置1
包装第一项,用配置2
包装其余项。 cObjNum
的文档记录不是很好,但是您可以查看源代码单元测试以了解以下格式:\TYPO3\CMS\Core\Tests\Unit\Service\TypoScriptServiceTest::explodeConfigurationForOptionSplitProvider