【发布时间】:2018-12-10 09:59:22
【问题描述】:
我开发了一个使用图像的内容元素。因为它将图像输出为内联样式元素:<div style="/fileadmin/_processed_/2/a/csm_article-image-1.4_a50d0b1375.jpg">[..]</div>,所以我想为编辑器的 CE 抑制 FAL 字段 alt、title 和 description。
示例: 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';
【问题讨论】:
-
由于 Rudy Gnoddy 的回答对您有所帮助,您可以将其选择为“已接受”,而不是将他的代码建议复制到您的问题中。
-
您在“接受”之后的评论感觉有点冒犯。我不只是复制他的解决方案。我根据 Rudy 的回答发布了我的问题的代码。
-
我不想冒犯你——你的代码标题(“[...] 完美无瑕:”)给我的印象是它只是被复制的。对不起归责。我只是想指出,通过相应地标记有用的答案来表示对受访者的感谢是公平的。