Hi, in elgg 5.x.x, I used to extend 'elgg.js' this way in elgg-plugin.php
'view_extensions' => [
'elgg.js' => [
'xxx/xxx/context.js' => []
]
]How to do it in elgg 6.x.x
Regards,
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Jerome Bakker@jeabakker

Jerome Bakker - 0 likes
- Jerome Bakker@jeabakker

Jerome Bakker - 0 likes
You must log in to post replies.In Elgg 6.x we switched from RequireJS to the native ESM modules for Javascript.
https://learn.elgg.org/en/stable/appendix/upgrade-notes/5.x-to-6.0.html#es-modules
Is there a need to extend the 'global' JS or could you rewrite your code to make use of the ESM modules. (If your JS is only needed on a few pages it's better to use an ESM module).
If your your needs to be present on all pages and you can't use an ESM module you can extend the 'elgg.mjs' view (instead of 'elgg.js').
Also have a look at https://learn.elgg.org/en/stable/guides/javascript.html