wazum / sluggi

The TYPO3 CMS slug helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaScript from the backend is included in the frontend

devtroll opened this issue · comments

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

$pageRenderer->loadRequireJsModule('TYPO3/CMS/Sluggi/Sluggi');

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

  • DDEV
  • PHP 8.1
  • TYPO3 v11

Greetings from Germany

@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.