#105497Overwrite HTML template of own backend module in TYPO3 13
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
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 4
-
Andreas Kienast commented and changed status
NewNeeds Feedback 10/28/24, 13:37 -
Alex Kellner commented 10/28/24, 13:49
Summary: Ticket can be closed – thank you
Yes, even if I already tested it, I double-checked my code and this helped:
templates.in2code/lux.1643293191 = in2code/luxenterprise:/Resources/Private/
I keep stumbling over the problem that the templates folder should not be specified here
-
Andreas Kienast commented and changed status
Needs FeedbackClosed 10/28/24, 13:53Closed as requested.
-
Benni Mack commented 10/28/24, 14:05
OK. But that means this change was available for v12 already (just for the future-me finding this ticket) and the old syntax worked in v11/v12 and in v12 one could use both variants already?
Please see the breaking change and the related feature for further information.
Does this help with your use-case?