Edit library.json file
Submitted by developer246 on Mon, 03/18/2024 - 09:39
Forums:
Hi!
I'm encountering an issue while attempting to edit the library.json
file for the H5P Memory Game content type. Despite making changes and saving the file, I'm not seeing any updates reflected. It seems that the file isn't recognizing any modifications.
I'm wondering if there's a hook available, similar to those used with semantics, that I could use to edit the library.json
file. Specifically, I need to add more content to the preloadedDependencies
array.
Thank you in advance for your help.
Summary:
Cannot edit library.json file
Content types:
otacke
Tue, 03/19/2024 - 00:58
Permalink
Hi!You're changes are not
Hi!
Your changes are not registered, because H5P only retrieves the information once when installing the library, puts it into the database and then uses it from there.
There's no hook to modify library.json, but nobody is stopping you from using the alter_scripts hook from to add extra JavaScript.
If you're customizing an H5P content type to a level that it requires extra libraries to work, this may be an indicator that you're better off forking the content type. It likely won't work without your custom hooks being in place anyway, and your life gets a lot easier not having to use hooks in the first place.
Best,
Oliver