Dang… sometimes Drupal really makes you suffer…
But I love it anyhow… poor Drupal, nobody likes it because nobody understands it, LOL.
Second, the thing I found hard to do was to modify the parameters dynamically, in my case was by using my module’s settings.
So, in other words having something like this:
your_id is the value you want to change dynamically.
In order to achieve that you need to:
Create the yourmodule.module file
The usual, you need a custom module, with the .module file, as per official documentation:
You have to implement the:
/** * Implements hook_js_alter(). */
And, here comes the interesting part:
To be noted that you also have to include the following include:
In my case I had to call also the
_webform_asset_alter function, but my guess is that it’s only needed in my specific case as I’m integrating it into a webform.
That’s it, I won’t explain how you add a library as it is documented already (see my first link to the official documentation).