php - TYPO3 BackendCustom Tab Rendering - Stack Overflow

This might be a really ambitious task.I try to extend the function "renderTabMenu" from&quo

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

相关推荐

  • php - TYPO3 BackendCustom Tab Rendering - Stack Overflow

    This might be a really ambitious task.I try to extend the function "renderTabMenu" from&quo

    23小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信