gpt4 book ai didi

typo3 - TCA 文件,复选框默认选中

转载 作者:行者123 更新时间:2023-12-02 00:51:26 24 4
gpt4 key购买 nike

我想将后端的复选框设置为默认选中。

在我的例子中,它是文件 /typo3conf/ext/news/Configuration/TCA/tx_news_domain_model_media.php 中的字段 showinpreview

我把值default改成了1,但是没有效果:

'showinpreview' => [
'exclude' => 1,
'label' => $ll . 'tx_news_domain_model_media.showinpreview',
'config' => [
'type' => 'check',
'default' => 1
]
],

当我检查 tt_content 的 TCA 文件中的复选框时,它看起来像这样:

'sectionIndex' => [
'exclude' => 1,
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:sectionIndex',
'config' => [
'type' => 'check',
'default' => 1,
'items' => [
'1' => [
'0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled'
]
]
]
],

我看到的唯一区别是 items。但是我真的不明白这个 item-value 的作用。

最佳答案

更改此值的最简单方法是用一些 pageTS 覆盖 TCA。将以下内容添加到保存新闻记录的文件夹的页面中。

TCAdefaults.sys_file_reference.showinpreview = 1

参见 https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TCEform/Index.html

对于较旧的 EXT:news 版本,请使用:TCAdefaults.tx_news_domain_model_media.showinpreview = 1

关于typo3 - TCA 文件,复选框默认选中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39470383/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com