I am working with TYPO3 CMS. I would like to add external JavaScript and CSS into a backend module, but I am actually not sure how to add these. Could you guide me how to implement that?
How to add external JavaScript and CSS into backend module in TYPO3
Via FLUID template fx: Layout/Default.html
<f:be.container
includeCssFiles="{0: '{f:uri.resource(path:\'Css/Styles.css\')}'}"
includeJsFiles="{0: '{f:uri.resource(path:\'JavaScript/Library1.js\')}', 1: '{f:uri.resource(path:\'JavaScript/Library2.js\')}'}">
your module content
</f:be.container>
Ya,
f:be.container
is deprecated since TYPO3v11 and removed in TYPO3v12. Use f:be.pageRenderer
as mentioned by Oliver Hader. But works only, if your Controller renders via ModuleTemplate. See docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.3/… –
Cown © 2022 - 2024 — McMap. All rights reserved.
f:be.container
view-helper also adds additional boilerplate markup that is used for backend modules (header,footer, ...). It's possible to usef:be.pageRenderer
as an alternative which just concerns the resource loading aspects of stylesheet and JavaScript files. – Gaddis