Project

General

Profile

Actions

Bug #105497

closed

Overwrite HTML template of own backend module in TYPO3 13

Added by Alex Kellner 3 days ago. Updated 3 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2024-10-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In the past we used TypoScript to overwrite templates, when an additional extension is installed. In our case a template is rendered for AnalysisController->dashboardAction(). But wenn LUXenterprise is also installed, a different template should be used for the backend module. The old code stopped working - event if the additional extension is installed, only the template from basic extension is loaded.

Structure

Controller:

class AnalysisController extends AbstractController
{
    public function dashboardAction(): ResponseInterface
    {
        // pass somthing to view do something
        return $this->moduleTemplate->renderResponse('Analysis/Dashboard');
    }
}

TypoScript:

module {
  tx_lux.view {
    templateRootPaths.0 = EXT:lux/Resources/Private/Templates/
    templateRootPaths.1 = EXT:luxenterprise/Resources/Private/Templates/
    partialRootPaths.0 = EXT:lux/Resources/Private/Partials/
    partialRootPaths.1 = EXT:luxenterprise/Resources/Private/Partials/
    layoutRootPaths.0 = EXT:lux/Resources/Private/Layouts/
    layoutRootPaths.1 = EXT:luxenterprise/Resources/Private/Layouts/
  }
}

Note: This issue prevents us from releasing a LUX version for TYPO3 13 at the moment.
In addition, I'm not sure if using $this->moduleTemplate->render() is the way to go, but following the documentation seems to be broken (see #105496).
I also tried to overwrite templates via Page TSConfig, but this seemed not to work.

Would be happy for any suggestion here,

Alex

Actions

Also available in: Atom PDF