Bug #78195
closed
WizIcon not shown in new content element list any more
Added by Aimeos no-lastname-given about 8 years ago.
Updated about 6 years ago.
Description
Hi all
In TYPO3 8.3 the wizard icons for the extension isn't shown any more, only a default "file not found" icon instead. The used code up to now is:
$relpath = ExtensionManagementUtility::extRelPath( 'aimeos' );
$wizardItems['plugins_tx_aimeos'] = array(
'icon' => $relpath . 'Resources/Public/Icons/Extension.png',
'title' => $GLOBALS['LANG']->getLLL( 'ext-wizard-title', $xml ),
'description' => $GLOBALS['LANG']->getLLL( 'ext-wizard-description', $xml ),
'params' => '&defVals[tt_content][CType]=list'
);
The resulting icon path is "../typo3conf/ext/aimeos/Resources/Public/Icons/Extension.png".
- Status changed from New to Needs Feedback
Could you try EXT:aimeos/Resources/Public/Icons/Extension.png as icon path?
Wouter Wolters wrote:
Could you try EXT:aimeos/Resources/Public/Icons/Extension.png as icon path?
No, this doesn't work either.
Hello Aimeos
I have try it like this, and it works :)
1. in your page TS config:
mod.wizards.newContentElement.wizardItems.plugins {
elements {
plugin_name {
iconIdentifier = extension-yourkey
title = LLL:EXT:extkey/Resources/Private/Language/locallang_db.xlf:pluginWizardTitle
description = LLL:EXT:extkey/Resources/Private/Language/locallang_db.xlf:pluginWizardDescription
tt_content_defValues {
CType = list
list_type = plugin_name
}
}
}
}
2. in ext_tables.php:
<?php
call_user_func(function () {
/**
* Register icons
*/
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
'extension-yourkey',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:extkey/Resources/Public/Icons/name.svg']
);
});
Yours
Xiaoling Peng
Thanks but this approach is very complicated and incompatible with TYPO3 6.2 and 7.6.
I think the change behind which makes the Wizicons break now was not intended because the documentation only says that icons should be in extkey/Resources/Public/Icons/Extension.svg now.
The full code that works with TYPO3 6.2 and 7.6 is:
namespace Aimeos\Aimeos\Custom;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Localization\LocalizationFactory;
class Wizicon
{
public function proc( $wizardItems )
{
$path = ExtensionManagementUtility::extPath( 'aimeos' );
$relpath = ExtensionManagementUtility::extRelPath( 'aimeos' );
$langfile = $path . 'Resources/Private/Language/extension.xlf';
$languageFactory = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Localization\LocalizationFactory' );
$xml = $languageFactory->getParsedData( $langfile, $GLOBALS['LANG']->lang, '', 0 );
$wizardItems['plugins_tx_aimeos'] = array(
'icon' => $relpath . 'Resources/Public/Icons/Extension.png',
'title' => $GLOBALS['LANG']->getLLL( 'ext-wizard-title', $xml ),
'description' => $GLOBALS['LANG']->getLLL( 'ext-wizard-description', $xml ),
'params' => '&defVals[tt_content][CType]=list'
);
return $wizardItems;
}
}
and in ext_tables.php:
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['Aimeos\\Aimeos\\Custom\\Wizicon'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath( $_EXTKEY ) . 'Classes/Custom/Wizicon.php';
- Category set to Backend API
- Status changed from Needs Feedback to New
- Status changed from New to Needs Feedback
@Aimeos no-lastname-given no-lastname-given
Sorry for the very late feedback; as far as I know (correct me if I am wrong) $iconRegistry->registerIcon
and iconIdentifier
is the way to go since version 7.6, while the other method should have been deprecated.
May I ask you if this issue can be closed or is there still work that should be done in this area? Thank you!
- Status changed from Needs Feedback to Closed
closed because of lack of feedback. 7 is now near EOL as well
Also available in: Atom
PDF