Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2016-10-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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".

Actions #1

Updated by Wouter Wolters about 8 years ago

  • Status changed from New to Needs Feedback

Could you try EXT:aimeos/Resources/Public/Icons/Extension.png as icon path?

Actions #2

Updated by Aimeos no-lastname-given about 8 years ago

Wouter Wolters wrote:

Could you try EXT:aimeos/Resources/Public/Icons/Extension.png as icon path?

No, this doesn't work either.

Actions #3

Updated by Xiaoling Peng about 8 years ago

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

Actions #4

Updated by Aimeos no-lastname-given about 8 years ago

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';

Actions #5

Updated by Alexander Opitz almost 8 years ago

  • Category set to Backend API
  • Status changed from Needs Feedback to New
Actions #6

Updated by Riccardo De Contardi over 6 years ago

  • 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!

Actions #7

Updated by Georg Ringer about 6 years ago

  • Status changed from Needs Feedback to Closed

closed because of lack of feedback. 7 is now near EOL as well

Actions

Also available in: Atom PDF