How to add external JavaScript and CSS into backend module in TYPO3
Asked Answered
I

1

5

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?

Individually answered 14/10, 2016 at 4:18 Comment(0)
C
7

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>
Cown answered 14/10, 2016 at 6:22 Comment(2)
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.Gaddis
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.