如何在编辑器的CE中抑制FAL字段?

loading...


0

我开发了一个使用图像的内容元素 . 因为它将图像输出为内联样式元素: <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配置是什么样的?

Edit: 来自@ 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';

loading...

2回答

  • 0

    您应该使用字段“assets”而不是“image”字段,assets字段将为您提供所有数据,如“title,link,alt etc”


  • 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 字段 .

评论

暂时没有评论!