JavaScriptLibraryInclude

Return to previous page

  • 4/7/2015
  • 602 Views

Comments

602 Views

JavaScriptLibraryInclude

Last updated 3 years ago

Comments

Common

(Enter the content of this article below)

Advanced

 

Background

In 7.2.0 DNN introduced the JavasScript Libraries as an extension type. This allows for site admins/module developers to package up javascript file(s) and register them as they would any other extension type (e.g. a module, language pack, skin etc.). As such they can be uninstalled, reinstalled or upgraded. In addition JavaScript Libraries are integrated into the Client Resource Management API to ensure multiple registrations only result in a single file being loaded -and as part of the CRM they can be optionally minified and concatenated.

The JavaScript Library extension also allows for the ability to specify loading a particular version, or a particular minor or major version. In all cases, DNN will resolve any duplications or clashes, and in the case where a specific version is requested but not available load the most applicable version of that library.

JavaScriptLibraryInclude control

Whilst typically developers will use the JavaScript Library API to register usage, in 7.3.0 (thanks to a code contribution), a new skin object has been added to help. This has 3 settings, with only "Name" being mandatory - an example of the declarative syntax is below:

<dnn:JavaScriptLibraryInclude runat="server" Name="myscript" Version="1.0.0" SpecificVersion="SpecificVersion.Latest"  />

As a Skin Object the settings can also be set via the settings definition e.g.


<Settings>

<Setting>
<Name>Name</Name>
<Type>String</Type>
<Help>The name of the JavaScript library</Help>
<Value></Value>
</Setting>
<Setting>
<Name>Version</Name>
<Type>Version</Type>
<Help>The version of the JavaScript library</Help>
<Value></Value>
</Setting>
<Setting>
<Name>SpecificVersion</Name>
<Type>SpecificVersion</Type>
<Help>How specificly the Version attribute should be applied</Help>
<Value></Value>
</Setting>
</Settings>


Contents
No sections defined
Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out