【问题标题】:Typo3 8.7: Name of module is not displayed in backendTypo3 8.7:模块名称未显示在后端
【发布时间】:2019-01-22 10:54:10
【问题描述】:

在我的 Typo3 8.7 扩展中,我为后端注册了一个模块。不幸的是,模块本身工作正常,名称没有显示。 (模块菜单左侧列表中的名称)。

我已经阅读了 doku 并按照那里所说的做了一切。我已经多次重新激活扩展并删除了所有缓存(也安装了缓存)。

这是我在ext_tables.php 中的代码:

if (TYPO3_MODE === 'BE') {
call_user_func(
    function ($extKey) {
        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
            'TYPO3.' . $extKey,   
            'Customer Administration',      
            'Customer Administration',          
            '',                    
            array(                  
                'BackendManagement' => 'list,  membershipInformationBackend',
                'FrontendManageCertificate' => 'showCertificateDetails'
            ),
            array(                 
                'access' => 'user,group',
                'icon' => 'EXT:' . $extKey . '/ext_icon_small.svg',
                'labels' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_shop_backend.xlf',
            )
        );

    },
    $_EXTKEY
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'someExt');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_someExt_domain_model_backendcustomer', 'EXT:someExt/Resources/Private/Language/locallang_csh_tx_someExt_domain_model_backendcustomer.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_someExt_domain_model_backendcustomer');
}

提前致谢。

【问题讨论】:

    标签: typo3 typo3-8.x


    【解决方案1】:

    来吧,我的朋友,我在你的代码中只发现了一个错误。您尚未传递翻译文件的密钥。这是可能的问题,请查看以下解决方案:

    ext_tables.php

    if (TYPO3_MODE === 'BE') {
    call_user_func(
        function ($extKey) {
            \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
                'TYPO3.' . $extKey,   
                'Customer Administration',      
                'Customer Administration',          
                '',                    
                array(                  
                    'BackendManagement' => 'list,  membershipInformationBackend',
                    'FrontendManageCertificate' => 'showCertificateDetails'
                ),
                array(                 
                    'access' => 'user,group',
                    'icon' => 'EXT:' . $extKey . '/ext_icon_small.svg',
                    'labels' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_shop_backend.xlf:shopModule', // Here is the problem
                )
            );
    
        },
        $_EXTKEY
    );
    
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'someExt');
    
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_someExt_domain_model_backendcustomer', 'EXT:someExt/Resources/Private/Language/locallang_csh_tx_someExt_domain_model_backendcustomer.xlf');
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_someExt_domain_model_backendcustomer');
    }
    

    locallang_shop_backend.xlf

    <trans-unit id="shopModule">
        <source>Shop Management</source>
    </trans-unit>
    

    建议:如果您使用扩展生成器创建了扩展,则会有一个名为 locallang_db.xlf 的自动生成文件使用此文件进行后端标记。

    希望这是有道理的!

    【讨论】:

    • 谢谢你,你完全正确!不知道我怎么错过了那里的钥匙.. ;)
    猜你喜欢
    • 2019-07-02
    • 1970-01-01
    • 2018-10-03
    • 2015-04-24
    • 2020-04-27
    • 2013-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多