typo3 - Typo3 V9 从整个页面中选择随机 DCE 显示在特定页面上
问题描述
我有一个自己的 DCE 元素,我想在起始页上显示一个随机元素。当我通过and
选择 CType 时,我必须输入一个.
但我想要整个站点的 CE,而不是特定的 uid。 10 = CONTENT
select
pidInList
我如何在 sql 语句中禁用它?
我当前的代码:
10 = CONTENT
10 {
table = tt_content
select {
selectFields = *, rand() as virt_rnd
pidInList = *
where = colPos=0 and CType=dce_ref
max = 1
orderBy = virt_rnd
languageField = sys_language_uid
}
解决方案
你可以使用:
select {
selectFields = *
pidInList = root
recursive = 10
orderBy = rand()
where = colPos=0 and CType=dce_ref
max = 1
languageField = sys_language_uid
}
使用根页面 (uid = 0) 和 10 级深度的所有页面(如果您的页面树更深,则使用更多)
推荐阅读
- java - put not working on android Volley org.json.JSONException: End of input at character 0 of
- multithreading - 编写测试以在多线程环境中使用 Kafka 消费者
- c# - 如何从 SQL Server 存储过程调用嵌套 json 到 C# 中的 API 调用
- javascript - 如何在 Firebase Firestore 中的每个文档的子集合中获取文档?
- kotlin - Mutiny:从单个 uni 超时中恢复
- powershell - -PropertyType 设置为 DWord,但在创建项目时它以字符串形式出现
- xml - 使用xslt将元素从父节点重复到子节点
- android - 创建有价值的资源文件
- flutter - 如何用底部创建 SliverAppBar
- python - PySpark 上 GBT 分类器的交叉验证在 2 GB 数据上花费了太多时间(80% 训练和 20% 测试)。有没有办法减少时间?