Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

JavaScriptLibraryInclude

Return to previous page

  • 4/7/2015
  • 2174 Views

Comments

2174 Views

JavaScriptLibraryInclude

Last updated long time 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
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out