首页 > 解决方案 > TYPO3:从另一个扩展覆盖 TCA 后端类公共变量

问题描述

我正在使用 Typo3 的 tx_news 扩展。因此,我想禁用一些在我的页面上未使用的设置,例如类别:

我已经在 PageTS 中为这样的记录禁用了它们:

TCEFORM {
    tx_news_domain_model_news {
        categories.disabled = 1
    }
}

从管理过滤器和列中删除它们:

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

现在,我还想在将插件添加到页面时在插件设置中禁用它们。在 BackendUtility.php 中,我发现以下几行将为我执行此操作(请注意,我添加了类别 categoryConjunction,..):

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

当然,像这样我已经禁用了类别,但是通过直接编辑扩展而不是从我自己的扩展中覆盖它,这意味着当我更新 tx_news 时,我将丢失该配置。

我必须添加什么 $GLOBALS[TCA].. 才能获得相同的结果?我在后端调试中找不到任何东西...

我正在搜索类似的东西(或一些 TypoScript 的东西,如果可能的话):

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

我感谢所有的帮助!

标签: phptypo3overridingtx-news

解决方案


你有没有试过这样的 TsConfig

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
                }
            }
        }
    }
}

推荐阅读