Search code examples
typo3typo3-9.xtx-newstypo3-extensions

TYPO3 9.5.x with news 7.2.x: Custom properties


I've extended TYPO3 9.5.x with news extension 7.2.x with some custom properties.

I used the manual I found here.

In general, everything works, but somehow the custom properties I created seem to be blank at the frontend. After clearing the cache, everything works again, but after some time the same issue appears again.

What am I doing wrong? Maybe it has something to do that I'm working with TYPO3 9.5.x and the manual is written for TYPO3 7.6.x?

Thanks for your help!


Solution

  • move your TCA modifying code (from ext_tables) to /typo3conf/ext/yourEXT/Configuration/TCA/Overrides/tx_news_domain_model_news.php

    something like this:

    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']);