我在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()
一起使用,以设置下拉菜单的图标。我该怎么做?
答案 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