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?

1 Answer 1

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>
Sign up to request clarification or add additional context in comments.

2 Comments

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.
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/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.