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?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742417264a4439983.html
评论列表(0条)