【发布时间】:2016-09-12 14:28:36
【问题描述】:
我正在尝试将新的复选框字段“showinhome”添加到表“tx_news_domain_model_media”与字段“showinpreview”相同这是我在 Configuration/TCA/Overrides/tx_news_domain_model_media.php 中的 TCA 配置
$temporaryColumns = [
'showinhome' => [
'exclude' => 1,
'label' => 'Show in Home',
'config' => [
'type' => 'check',
'default' => 0,
],
],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'tx_news_domain_model_media',
$temporaryColumns
);
$GLOBALS['TCA']['tx_news_domain_model_media']['ctrl']['label_alt'] .= ', showinhome';
$GLOBALS['TCA']['tx_news_domain_model_media']['interface']['showRecordFieldList'] .= ', showinhome';
$GLOBALS['TCA']['tx_news_domain_model_media']['palettes']['newsPalette']['showitem'] .= 'showinhome,';
字段不显示,谁能帮帮我?
【问题讨论】:
-
最后一行字段名前不应该有逗号吗?
$GLOBALS['TCA']['tx_news_domain_model_media']['palettes']['newsPalette']['showitem'] .= ',showinhome'; -
$TCA['tx_news_domain_model_media']['palettes']['paletteCore']['showitem'] = 'type,showinpreview, hidden,sys_language_uid, l10n_parent, l10n_diffsource,showinhome,';它出现在配置中,所以