常见的静态资源(图像,js,css等)在DotNetNuke中应该放在哪里? [英] Where should common static resources (images, js, css, etc) go in DotNetNuke?

查看:78
本文介绍了常见的静态资源(图像,js,css等)在DotNetNuke中应该放在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在DotNetNuke 5.x安装中是否有建议的位置来存储静态资源(图像,css,js等)?

Is there a recommended location to store static resources (images, css, js, etc) in a DotNetNuke 5.x installation?

有/images和/js文件夹以及包含资源的/Resources文件夹.由于MicrosoftAjax.js位于多个位置,因此似乎存在一些重叠(但可能是不同的版本吗?).我也可以将资源放在/DesktopModule/ModuleX位置.

There are /images and /js folders as well as a /Resources folder that contains resources. There appears to be some overlap as MicrosoftAjax.js is in multiple locations (but might be different versions?). I also could put resources in a /DesktopModule/ModuleX location.

有人知道使用这些文件夹是否有区别吗?

Does anyone know if there is a difference in using any of these folders?

我有点喜欢将所有静态资源都放在一个公共文件夹(/资源)下的想法,因此我可以在一个位置上设置缓存规则头,权限等.

I kinda like the idea of all static resources being under a common folder (/Resources) so I could set caching rule headers, permissions, etc on them in one place.

有人使用过单独的图像服务器来提供DotNetNuke静态内容吗?独立图像服务器的优缺点(例如images.mydomain.com)?

Has anyone used a separate image server to serve DotNetNuke static content? Pros and Cons of a separate image server (e.g. images.mydomain.com)?

推荐答案

如果您拥有整个DNN安装,那么将所有资源合并到一个位置(无论DNN使用的Resources文件夹,或DNN不知道的其他文件夹).如果要开发的模块要安装到您不完全拥有的站点上,那么考虑周到的事情是将资源限制在模块的DesktopModules文件夹中.

If you own the entire DNN installation, then it can certainly make sense to consolidate all of your resources into one place (whether its the Resources folder used by DNN, or a different folder that DNN doesn't know about). If you're developing a module that will be installed onto a site that you don't totally own, then the considerate thing to do is to constrain your resources within the DesktopModules folder for your module.

关于DNN文件夹的一些注意事项:

Some things to consider with regards to DNN folders:

  • 如果模块文件夹下有内容,则卸载该模块将为您提供删除该内容的选项.这可以帮助您保持事物的整洁有序,或者如果您有多个共享相同文件的模块定义,可能会很危险...(更危险的是卸载SQL脚本;请确保不要意外卸载)附加了卸载脚本的模块)
  • 您可以使用DNN文件管理器在Portals目录中上载/删除/重命名文件,因此,如果站点管理员应该控制文件,则可以在其中放置文件
  • 将内容放置在模块文件夹之外会使链接更加困难(特别是如果它位于特定于门户的文件夹中,即您每次都必须向PortalSettings对象询问路径)
  • 将资源保留在模块文件夹之外的情况很少见,因此,如果您将经验丰富的DNN开发人员带入项目,可能会造成混乱

这篇关于常见的静态资源(图像,js,css等)在DotNetNuke中应该放在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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