首页 文章

如何修改FAL参考的TCA ImageManipulation配置?

提问于
浏览
2

TYPO3 7.4 我有以下 TCA configuration 用于上传单个图像并启用新的 ImageManipulation (裁剪工具):

'single_image_field' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_db.xlf:sometable.single_image_field',
    'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
        'single_image_field',
        array(
            'maxitems' => 1,
            'appearance' => array(
                'collapseAll'   => 1,
                'expandSingle'  => 1,
            ),
            'foreign_types' => array(
                \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
                    'showitem' => '--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette'
                ),
            )
        ),
        'jpg,jpeg,png'
    ),
),

现在我想配置自定义 aspect ratio's . 对于列类型的 TCA configuration ,这似乎是可能的: ImageManipulation (参见:https://wiki.typo3.org/TYPO3.CMS/Releases/7.2/Feature#Impact_9) .

但是我如何在上面的配置中应用它呢?

1 回答

  • 4

    sys_file_reference 的默认 crop 方面 ratio's 可以覆盖如下:

    $GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config']['ratios'] = array(
        '1.7777777777777777' => '16:9',
        '1.3333333333333333' => '4:3',
        '1' => '1:1',
        'NaN' => 'Free',
    );
    

相关问题