How to add a new library
You'll need to install the dependencies (
yarn install) and then use the
script, which will prompt you for the various pieces of information
yarn install yarn run new
After that, if you want to ship any other files with the library (e.g. CSS
files), you'll want to add those into the
dnn-library.json file. You can then
commit your changes and submit a pull request on GitHub.
The installable packages are included within this GitHub repository as releases.
Starting in DNN 7.3, there is a skin object called
any 3rd party library) from a skin. To do that, you need to register the skin
object at the top of your skin:
Then, in the body of the skin, use the skin object to request the library:
The skin object mentioned above can also be used from HTML skins. It would look something like this:
in skins prior to DNN 7.3 and the introduction of the
skin object, as well as from extension code (though extensions can also make use
of the skin object, if desired). The primary entry point for the API is the
RequestRegistration method of the
The overload which doesn't specify a version will request the latest version of
the library. In order to avoid your extensions breaking unexpectedly, it's
probably best to always specify a version number. The second overload, which
includes the version number will request that specific version of the library.
If that version isn't installed, it will instead display an error. The third
overload is probably the best to use for most scenarios. It allows you to pass
a value indicating how specific the version is, as a value of the
SpecificVersion enum. The possible values are
Latest is the behavior of the overload with one
Exact is the behavior of the overload with two arguments, while the
other two values allow you to get behavior that is in between strict and loose.
This code is released under the MIT license. However, the individual libraries are licensed by their respective owners.