I have an issue with correct rendering views in Typo3 (backend extension) after upgrade from version 12 to 13.
In changelog I see information about deleted deprecated methods and potential new way to render views – class ModuleTemplate
can be used to render correct response (source: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-96730-SimplifiedExtbackendModuleTemplateAPI.html). I use it in my controllers, but unfortunately views are rendered without included Typo3 module layout (Module.html
). This leads to issues with basic styling and scrollbar: the scrollbar itself is missing and content is not accessible on the backend as it’s not possible to scroll down or up.
It seems that for some reason basic html wrapper from modules is not used: before the whole view was wrapped by div with class module
, example: <div class="module {moduleClass}" data-module-id="{moduleId}" data-module-name="{moduleName}">
.
Actually I use solution from this site:
https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-96730-SimplifiedExtbackendModuleTemplateAPI.html
$moduleTemplate = $this->moduleTemplateFactory->create($request);
$moduleTemplate->assign('aVariable', 'aValue');
return $moduleTemplate->renderResponse('MyTemplate');
I pass variables into view and later render response with my fluid template and it doesn’t work properly.
What I did:
- read changelog and official documentation
- searched information about potential other solutions without effects
- checked site, where users and other programmers report suggestions and errors
- asked ChatGPT (I don’t do this often, but I don’t have any other ideas)
- checked a few extensions how it works for Typo3 v13
- validated properly loading css styles and js (yes, it’s working correctly – css and js styles are included)
- include
<f:layout name="Module"/>
into my views – layout is still not used
To summarize: views are rendered with all required variables, but basic styling with scrollbar are missing.
Chanyss921 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.