[英]Can I preselect items in TYPO3's select elements in TCA?
I am configuring a custom backend field in pages TCA.我正在 TCA 页面中配置自定义后端字段。 There, I added a new select type field, with the renderType
selectCheckBox
.在那里,我添加了一个新的 select 类型字段,带有 renderType
selectCheckBox
。 The items to be selected are filled via an itemsProcFunc
that uses a custom PHP function.要选择的项目通过使用自定义 PHP function 的
itemsProcFunc
填充。
Is there a way to preselect certain, or all of the items when returning them in the itemsProcFunc
via $PA[items]
?有没有办法在通过
$PA[items]
在itemsProcFunc
中返回它们时预先选择某些或所有项目?
Two ways exist depending on use case:根据用例存在两种方式:
defValues
(bottom of page https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/Mod.html ). defValues
(bottom of page https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/Mod.html ). This is not the implementation you should use, as you mention you want this to be done for the pages
table, but I mention it for completeness in case other users come to this question through searches.pages
表完成此操作,但我提到它是为了完整性,以防其他用户通过搜索找到此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.