Reputation: 133
I need to figure out how to install any new jQuery plugin into DotNetNuke (DNN)
I'm pretty good with jQuery and I know how to reference the source files etc.
What I need to figure out is where in the code to include the <script>
tag to include the new plugin.
Currently what I'm doing is include the plugin script/CSS tags inside the HTML module of any given page.
I want to include the js/cs in the header or footer of files.
Upvotes: 4
Views: 2814
Reputation: 2746
There are a few options. With DNN 6.x or greater you generally should use the Client Resource Management API to Register the files. It's actually very easy as you just need to register a control:
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
And then include the specific file:
<dnn:DnnJsInclude runat="server" FilePath="jquery.cycle.min.js" PathNameAlias="SkinPath" />
We generally do this through the skin as we do custom skins for most of our sites or, if we're building a custom module that needs the plugin we'll do it in the appropriate ascx file for the module.
If you only need the plugin on a particular page and it's not for a particular module, the best place to add it is through the Page Settings -> Advanced -> Page Header Tags.
You can learn more here: http://www.dotnetnuke.com/Resources/Wiki/Page/Client-Resource-Management-API.aspx
Upvotes: 6