Search code examples
phptypo3overridingtx-news

TYPO3: Override TCA backend class public variables from another extension


I'm using the tx_news extension for Typo3. Therefore I'd like to disable some settings that are not used on my page, for instance categories:

I've already disabled them in the PageTS for the records like this:

TCEFORM {
    tx_news_domain_model_news {
        categories.disabled = 1
    }
}

Removed them from the administration filters and columns:

tx_news {
    module {
        columns = istopnews,datetime,author
        filters {
            categories = 0
            categoryConjunction = 0
            includeSubCategories = 0
        }
    }
}

Now I'd also like to disable them in the plugin settings when adding the plugin to the page. in the BackendUtility.php I found the following lines who will do that for me (notice I've added categories categoryConjunction,..):

public $removedFieldsInListView = [
   'sDEF' => 'dateField,singleNews,previewHiddenRecords,selectedList,categories,categoryConjunction,includeSubCategories',
   'additional' => '',
   'template' => ''
];

Of course like this I've already disabled the categories, but by directly editing the extension instead of overriding it from my own extension, that means when I update tx_news I will lose that configuration.

What $GLOBALS[TCA].. stuff do I have to add to get the same result? I can't find anything in the backend debugging...

I'm searching something like (or some TypoScript stuff if possible):

$GLOBALS['TCA']['tx_news_domain_model_news']['plugin']['backendUtility'][removeFieldsInListView]= 'bla, blabla, bla';

I appreciate all the help!


Solution

  • Have you tried some TsConfig like that

    TCEFORM {
        tt_content {
            pi_flexform {
                news_pi1 {
                    sDEF {
                        # Important is the escaping of the dot which is part of the fieldname
                        settings\.orderBy.disabled = 1
                    }
                }
            }
        }
    }