[英]TYPO3 how to modify TCA?
TYPO3 9, but is probably independent of TYPO3 version TYPO3 9,但可能与TYPO3版本无关
I have installed news
and eventnews
. 我已经安装了
news
和eventnews
。 eventnews
adds a field location_simple
to the table tx_news_domain_model_news
. eventnews
在表tx_news_domain_model_news
添加一个location_simple
字段。 In the backend this is of type input
. 在后端,这是
input
类型。 I want it to be of type text
. 我希望它是
text
类型的。 Therefore I added a file Configuration/TCA/Overrides/tx_news_domain_model_news.php
to my sitepackage: 因此,我将文件
Configuration/TCA/Overrides/tx_news_domain_model_news.php
到我的Configuration/TCA/Overrides/tx_news_domain_model_news.php
中:
<?php
if( !defined('TYPO3_MODE') ) {
die ('Access denied.');
}
// Modify location simple
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['location_simple']['config']['type'] = 'text';
But this has no effect. 但这没有效果。
My sitepackage is included at last position, so it should be able to overwrite the TCA of eventnews
. 我的站点包位于最后一个位置,因此它应该能够覆盖
eventnews
的TCA。 What is correct the magic for this? 什么是正确的魔术呢?
This worked for me: rename my site package extension so that it has an extension key alphabetically after 'e'. 这对我有用:重命名我的站点包扩展名,以便它在'e'之后按字母顺序具有扩展名。
It seems as if the files in /Configuration/TCA/Overrides are read alphabetically. 似乎按字母顺序读取/ Configuration / TCA / Overrides中的文件。 In my case I wanted to override
eventnews
. 就我而言,我想覆盖
eventnews
。 So my site package extension key had to begin with a letter in [fz]. 因此,我的网站软件包扩展密钥必须以[fz]中的字母开头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.