Within my skin I have a module container where I want to add a JavaScript file.
No problem, I use:
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnJsInclude runat="server" FilePath="script.js" PathNameAlias="SkinPath" />
Only problem is, that the script is located not in the skins folder:
Portals\_default\Skins\MySkin\script.js
but in the containers folder:
Portals\_default\Containers\MySkin\script.js
Adding above code won't work as it produces a link to the skin folder:
<script src="/Portals/_default/Skins/MySkin/script.js?cdv=18" type="text/javascript"></script>
If I use this simple code, it does work:
<script src='<%= SkinPath %>script.js' />
But then I lose all advantages of the ClientResourceManagement
!
Looking at the source and the documentation there are only two PathNameAlias
types and none of them are for containers.
The reason why I add the script to the containers folder, is that it's only used in that one container and nowhere else.
Anyone knows a solution?
Is it easy to implement my own PathNameAlias
?