For your case, which I suspect is the configuration of API keys for Google Maps, I would have a prevalue config option for the API key, or save it in the appSettings section of web.config (but then you would need some kind of API method, to get it from there).
Custom Property editors - is loading javascript files dynamically possible?
Hi all!
For Custom Property Editors, you normally set scripts in the package.manifest. which is fine in most cases and works great.
But what if you want to load for example the google maps api? There you can add paramaters to the url like language and apikey.
Can you add values directly from the config part of the manifest? Or can you dynamically load a script from the controller?
What are the possiblities/best practices?
Thanks in advance!
Bert
Hi Bert
You can dynamically load assets using the assets service. Check out the docs here: https://our.umbraco.org/apidocs/ui/#/api/umbraco.services.assetsService
For your case, which I suspect is the configuration of API keys for Google Maps, I would have a prevalue config option for the API key, or save it in the appSettings section of web.config (but then you would need some kind of API method, to get it from there).
Hi Søren
Thanks for the advice! This is exactly what I'm looking for :)
is working on a reply...