wazum / sluggi

The TYPO3 CMS slug helper
GNU General Public License v3.0
39 stars 22 forks source link

JavaScript from the backend is included in the frontend #77

Closed devtroll closed 2 years ago

devtroll commented 2 years ago

Before I describe my problem, let me first say that this is a great extension.

Unfortunately, including the JavaScript file in the "ext_localconf.php" file in the frontend loads the backend JavaScript libraries. The reason for this is that the call to the line

https://github.com/wazum/sluggi/blob/fb4aae94eaa92172eb6aa8b04a057bf8c194088c/ext_localconf.php#L16

integrates the RequireJS module from the backend into the frontend and thus "prepares" all JavaScript library. Since I use libraries in the frontend that conflict with RequireJS, I am therefore currently unable to use the extension.

A query on the TYPO3_MODE will unfortunately also no longer work, since this is deprecated since TYPO3 11. The only possibility would be to include it via hook.

Can you possibly implement this change?

System environment

Greetings from Germany

freshworkx commented 2 years ago

@devtroll I think it is not necessary to go for extra PageRendererRenderPreProcess.php class. According to the documentation https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/JavaScript/RequireJS/Loading/Index.html it should be possible to set own RequireJS module via backend template or controller. Therefore, it should then also be loaded only in the backend context.