Starting with TYPO3 v12 extensions are no longer inside the webserver's document root and the Resources/Public folder is symlinked to _assets/SOME-RANDOM-HASH. When adding CSS, JavaScripts or images within the template by TypoScript or Fluid you can use EXT:my_extension_name to link into the extensions Resources/Public folder but what possibilities or strategies are there when you're using an external JavaScript or need to link to an image from an HTML content element?
Because extensions are used to define the websites 'theme' or 'template' as well, I see no security issue when using the real extension name for the symlink in _assets for these 'extensions'. So is there an option (for example within the composer.json) to use the extension's real name when symlinking it?
Are there any 'best practices' on linking to static files that are part of the website's theme?
There are some ways:
<body data-asset="...">
). Then use JavaScript to retrieve the DOM attribute value, and use it for what you want to achieve.HTH!