mhirdes / go_maps_ext

Google Maps Extension for TYPO3
MIT License
21 stars 31 forks source link

[FEATURE] Make ScriptViewHelper placement configurable with Extension Configuration basic.footerJS #105

Closed NitinParri closed 1 year ago

NitinParri commented 1 year ago

On line 46 of /Classes/ViewHelpers/ScriptViewHelper.php the Javascript is automatically place in footer with addJsFooterFile. This should be configurable with Extension Configuration basic.footerJS. If basic.footerJS = 0 it should be addJsFile.

mhirdes commented 1 year ago

Why would you not add the JS to the footer?

NitinParri commented 1 year ago

If you use an extension such as scriptmerger. With this extension for example you can load everything in the head first, minify and concatenate the script files to 1 file and then move it to the footer. If there is a JS file in footer, it will be processed in a separate file, which will give errors.

mhirdes commented 1 year ago

But if you place all the JS in the footer it would also work?

NitinParri commented 1 year ago

With some extensions it is not possible, because it is hardcoded just like this. Nevertheless if you have the option basic.footerJS = 0 it has to do what it says. Now it only does half the job.

mhirdes commented 1 year ago

May you test the commit?

NitinParri commented 1 year ago

Tested, works great, thanks!