如何在CE中为编辑器取消FAL字段?

时间:2018-12-10 09:59:22

标签: typo3 fal

我开发了一个使用图像的内容元素。因为它将图像作为内联样式元素输出:<div style="/fileadmin/_processed_/2/a/csm_article-image-1.4_a50d0b1375.jpg">[..]</div>,所以我想为编辑器的CE取消显示FAL字段alttitledescription

示例: screenshot

现在我使用以下TypoScript:

TCEFORM {
    sys_file_reference {
        alternative.disabled = 1
        description.disabled = 1
        title.disabled = 1
        link.disabled = 1
    }

}

但是此解决方案强制所有CE都隐藏file.metadata。

TCA配置是什么样的?

编辑: @ rudy-gnodde的解决方案可以完美地工作:

$GLOBALS['TCA']['tt_content']['types']['ce_image']['columnsOverrides']['image']['config']['overrideChildTca']['types'][0]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['types']['ce_image']['columnsOverrides']['image']['config']['overrideChildTca']['types'][1]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['types']['ce_image']['columnsOverrides']['image']['config']['overrideChildTca']['types'][2]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['types']['ce_image']['columnsOverrides']['image']['config']['overrideChildTca']['types'][3]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['types']['ce_image']['columnsOverrides']['image']['config']['overrideChildTca']['types'][4]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['types']['ce_image']['columnsOverrides']['image']['config']['overrideChildTca']['types'][5]['showitem'] = 'crop,--palette--;;filePalette';

2 个答案:

答案 0 :(得分:0)

您应该使用“资产”字段而不是“图像”字段,资产字段将为您提供所有数据,例如“标题,链接,替代等”

答案 1 :(得分:0)

如果您使用现有的image字段,则可以使用以下命令覆盖它应显示的字段:

$GLOBALS['TCA']['tt_content']['columns']['image']['config']['overrideChildTca']['types'][0]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['overrideChildTca']['types'][1]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['overrideChildTca']['types'][2]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['overrideChildTca']['types'][3]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['overrideChildTca']['types'][4]['showitem'] = 'crop,--palette--;;filePalette';
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['overrideChildTca']['types'][5]['showitem'] = 'crop,--palette--;;filePalette';

如果是自定义字段,则应将overrideChildTca中的零件添加到该字段的TCA配置的配置中。

这只会显示Image manipulation字段。

相关问题