admin管理员组文章数量:1336643
This might be a really ambitious task.
I try to extend the function "renderTabMenu" from "vendor/typo3/cms-backend/Classes/Form/Container/AbstractContainer.php" with my own templates.
The problem is that there is no built in solution for this though the templates are kinda hardwired. (comment in source code)
I've already tried to find a solution via event listeners or extend the child class TabsContainer but without success so far.
Here's the function for the template rendering.
protected function renderTabMenu(array $menuItems, $domId, $defaultTabIndex = 1)
{
// @todo: It's unfortunate we're using Typo3Fluid TemplateView directly here. We can't
// inject BackendViewFactory here since __construct() is polluted by NodeInterface.
// Remove __construct() from NodeInterface to have DI, then use BackendViewFactory here.
$view = GeneralUtility::makeInstance(TemplateView::class);
$templatePaths = $view->getRenderingContext()->getTemplatePaths();
$templatePaths->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates')]);
$templatePaths->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Partials')]);
$view->assignMultiple([
'id' => $domId,
'items' => $menuItems,
'defaultTabIndex' => $defaultTabIndex,
'wrapContent' => false,
'storeLastActiveTab' => true,
]);
return $view->render('Form/Tabs');
}
My goal is to use my own partial for the backend tab rendering located at
Resources/Private/Backend/Partials/ModuleTemplate/Tabs.html
Does anyone got an idea how to do this?
本文标签: phpTYPO3 BackendCustom Tab RenderingStack Overflow
版权声明:本文标题:php - TYPO3 BackendCustom Tab Rendering - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742417264a2470957.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论