在我的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');
}
谢谢。
答案 0 :(得分: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 的文件,并使用此文件进行后端标记。
希望这很有道理!