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?
1 Answer
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>
2 Comments
Oliver Hader
The
f:be.container view-helper also adds additional boilerplate markup that is used for backend modules (header,footer, ...). It's possible to use f:be.pageRenderer as an alternative which just concerns the resource loading aspects of stylesheet and JavaScript files.jokumer
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/…