DNN-如何为Bootstrap/JQuery文件添加CDN(云)引用? [英] DNN - How can I add CDN (cloud) references for Bootstrap / JQuery files?

查看:121
本文介绍了DNN-如何为Bootstrap/JQuery文件添加CDN(云)引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DotNetNuke(DNN 9.0)网站,并且我看到CSS/JQuery文件在* map.XML文件中被引用为主目录,如下所示:

  <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>

我想对这些引用进行更多控制,例如能够引用cloud(CDN)链接,例如JQuery在下面提供了CDN:

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

我的问题是我无法找到引用这些文件的map.XML文件以外的任何其他文件,并且该XML文件似乎不是CDN引用或任何修改的正确位置,因为DNN会重新生成此文件并覆盖手动添加./p>

您的想法将不胜感激.

解决方案

自DNN 9以来,它有点隐藏.转到设置" >>扩展",从下拉列表中选择"JavaScript库",然后单击JavaScript jQuery库旁边的铅笔. ,选择扩展设置"标签,然后在自定义CDN"设置中输入网址".

由于不包含Bootstrap库,因此必须创建它-感谢Brian Dukes,已经将许多流行的库打包为DNN安装文件,因此您可以转到

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.

解决方案

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).

这篇关于DNN-如何为Bootstrap/JQuery文件添加CDN(云)引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆