0

I need to activate the "Image editor" for TYPO3 (8.7) sys_categories. In every other Element which uses FAL the editor is available. Only in the Category Images I did not have this option.

How do I active it?

I've tried to set the exact same TCA to this field but no changes. enter image description here

Here is the TCA (of the tx_news) Extension:

'images' => [
    'exclude' => true,
    'l10n_mode' => 'mergeIfNotBlank',
    'label' => $ll . 'tx_news_domain_model_category.image',
    'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
        'images',
        [
            'appearance' => [
                'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference',
                'showPossibleLocalizationRecords' => true,
                'showRemovedLocalizationRecords' => true,
                'showAllLocalizationLink' => true,
                'showSynchronizationLink' => true
            ],
            'foreign_match_fields' => [
                'fieldname' => 'images',
                'tablenames' => 'sys_category',
                'table_local' => 'sys_file',
            ],
        ],
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
    )
]

Also this file on GitHub: https://github.com/georgringer/news/blob/master/Configuration/TCA/Overrides/sys_category.php

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Kevin Lieser
  • 951
  • 1
  • 9
  • 25

2 Answers2

0

You might compare your TCA with the configuration for field assets in record tt_content.

As the cropping is stored in sys_file_reference I would have a closer look to the showitem value "imageoverlayPalette"

Bernd Wilke πφ
  • 10,390
  • 1
  • 19
  • 38
  • Thanks for you hint! Found the solution: The "foreign_types" with the palettes were missing. Edited my question with the answer. Thanks! – Kevin Lieser Dec 06 '18 at 10:46
0

Answer

The config index "foreign_types" were missing. Override the TCA settings like this and it works:

<?php
defined('TYPO3_MODE') or die();

$ll = 'LLL:EXT:news/Resources/Private/Language/locallang_db.xlf:';


$newSysCategoryColumns = [
    'images' => [
        'exclude' => true,
        'label' => $ll . 'tx_news_domain_model_category.image',
        'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
            'images',
            [
                'behaviour' => [
                    'allowLanguageSynchronization' => true,
                ],
                'appearance' => [
                    'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference',
                    'showPossibleLocalizationRecords' => true,
                    'showRemovedLocalizationRecords' => true,
                    'showAllLocalizationLink' => true,
                    'showSynchronizationLink' => true
                ],
                'foreign_match_fields' => [
                    'fieldname' => 'images',
                    'tablenames' => 'sys_category',
                    'table_local' => 'sys_file',
                ],
                'foreign_types' => array(
                    '0' => array(
                        'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                        --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
                        'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                        --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
                        'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                        --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
                        'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                        --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
                        'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                        --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
                        'showitem' => '
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                        --palette--;;filePalette'
                    )
                ),
            ],
            $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
        )
    ],
];


\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_category', $newSysCategoryColumns);
Kevin Lieser
  • 951
  • 1
  • 9
  • 25