0

I have a DotNetNuke (DNN 9.0) website, and I see CSS/JQuery files are referenced as entrees in a *map.XML file, such as below:

  <item key="7d14598udfghjho0348dfdgvt4644" file="" compression="" version="180">
    <files>
      <file name="/Resources/libraries/jQuery/01_09_01/jquery.js" />
      <file name="/Resources/libraries/jQuery-UI/01_11_03/jquery-ui.js" />
    </files>
  </item>

I want to have more control on these references, such as being able to reference cloud(CDN) links instead, for example JQuery provides CDN below:

<script
  src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"
  integrity="sha256-xI/qyl9vpwWFOsdaf/9WkG5j/SVasdf1viy8fWwbeE="
  crossorigin="anonymous">
</script>

My problem is I cannot locate anywhere other than map.XML file that is referencing these files, and this XML file doesnot seem to be the right place for CDN references or any modifications because DNN regenerates this file and overrides manual additions.

Your ideas will be appreciated.

David
  • 239
  • 3
  • 10

2 Answers2

1

It is a bit hidden since DNN 9. Go to Settings >> Extensions, select JavaScript Libraries from the dropdown list, click the pencil next to the JavaScript jQuery library, select the Extension Settings tab and enter the Url in the Custom CDN setting.

As the Bootstrap library is not included, you have to create it - thanks to Brian Dukes, a lot of popular libraries are already packaged as a DNN install file, so you can go to https://github.com/EngageSoftware/DNN-JavaScript-Libraries, download and install it. Then you can do the same as above.

If you don't find that it could be that the setting was not there in your DNN 9.0.x version - anyway, this is old and a lot of security issues have been fixed since then, so consider upgrade to a newer version (9.5.0 is current at the moment).

enter image description here

David
  • 239
  • 3
  • 10
Michael Tobisch
  • 1,034
  • 6
  • 15
  • 2
    Please note that if you do this, post upgrade most likely these values will revert – Mitchel Sellers Mar 05 '20 at 15:56
  • I tried changing the Custom CDN but I see website still falls on local JS resource at runtime. Should the application be restarted after this change? – David Mar 05 '20 at 19:57
0

I added CDN references in "Custom CDN" but after refreshing the page still local JQuery resources were loaded. I found this blog which is addressing same, and it seems admin needs to update the DNN database table directly in order to enable this.

  SELECT s.SettingName, s.SettingValue
  FROM  [HostSettings] as s
  WHERE SettingName = 'CDNEnabled'  OR SettingName LIKE '%Custom%jQuery%'

enter image description here

David
  • 239
  • 3
  • 10
  • If this is really not working in the UI please add an issue here: https://github.com/dnnsoftware/Dnn.Platform/issues - or comment that you have the same problem if there is alredy an open issue wih this. – Michael Tobisch Mar 17 '20 at 16:15