带有自定义内容元素的iconidentifier的TYPO3后端图标

时间:2019-03-18 11:51:52

标签: typo3 typo3-8.x

我在ext_localconf.php中将图标注册为:

<?php
use TYPO3\CMS\Core\Imaging\IconRegistry;
$extKey = 'xxx';
if (TYPO3_MODE === 'BE') {
    /** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
    $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(IconRegistry::class);
    $iconRegistry->registerIcon(
        'xxx_intro-icon-identifier',

        \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
        ['source' => 'EXT:' . $extKey . '/Resources/Public/icons/baseline-web_asset-24px.svg']
    );

我想将tt_content.php中的图标\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin()一起使用,以设置下拉菜单的图标。我该怎么做?

1 个答案:

答案 0 :(得分:0)

我知道这个解决方案:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
    'tt_content',
    'CType',
    [
        'LLL:EXT:your_extension/Resources/Private/Language/locallang_db.xlf:your_ctype.title',
        'your_ctype',
        'your_icon_identifier'
    ],
    'textmedia',
    'after'
);

将此代码段放入Configuration/TCA/Overrides/tt_content.php