Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带有新闻7.2.x的TYPO3 9.5.x:自定义属性_Typo3_Typo3 9.x_Tx News_Typo3 Extensions - Fatal编程技术网

带有新闻7.2.x的TYPO3 9.5.x:自定义属性

带有新闻7.2.x的TYPO3 9.5.x:自定义属性,typo3,typo3-9.x,tx-news,typo3-extensions,Typo3,Typo3 9.x,Tx News,Typo3 Extensions,我用新闻扩展7.2.x扩展了TYPO3 9.5.x,并使用了一些自定义属性 我用了我找到的手册 一般来说,一切正常,但不知何故,我创建的自定义属性在前端似乎是空白的。清除缓存后,所有内容都会再次工作,但一段时间后,同样的问题再次出现 我做错了什么?也许是因为我在使用TYPO3 9.5.x,而手册是为TYPO3 7.6.x编写的 谢谢你的帮助 将TCA修改代码(从ext_表)移动到/typo3conf/ext/yourEXT/Configuration/TCA/Overrides/tx_news_

我用新闻扩展7.2.x扩展了TYPO3 9.5.x,并使用了一些自定义属性

我用了我找到的手册

一般来说,一切正常,但不知何故,我创建的自定义属性在前端似乎是空白的。清除缓存后,所有内容都会再次工作,但一段时间后,同样的问题再次出现

我做错了什么?也许是因为我在使用TYPO3 9.5.x,而手册是为TYPO3 7.6.x编写的


谢谢你的帮助

将TCA修改代码(从ext_表)移动到/typo3conf/ext/yourEXT/Configuration/TCA/Overrides/tx_news_domain_model_news.php

大概是这样的:

defined('TYPO3_MODE') or die();

( function( &$tca) {

    $tempColumns = array(
        'NEW_FIELD' => array(
           'exclude' => 0,
           'label' => 'LLL:EXT:yourEXT/Resources/Private/Language/locallang_be.xlf:tx_newsextend_domain_model_news.NEW_FIELD',
           'config' => array(
              'type' => 'check',
              'default' => 0
           ),
        ),
     );

     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
        'tx_news_domain_model_news',
        $tempColumns
     );

     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes("tx_news_domain_model_news", 'NEW_FIELD', '', 'after:title');

})( $GLOBALS['TCA']['tx_news_domain_model_news']);

非常感谢。我已经移动了代码,如果问题仍然发生,我将在接下来的两天内查看。如果没有,我将接受你的回答。:)对不起,我上周忘了收。它似乎起作用了,问题解决了。再次感谢你!