Where do shared static resources (images, js, css, etc.) go into DotNetNuke?
Is there a recommended place to store static resources (images, css, js, etc.) in a DotNetNuke 5.x installation?
There are / images and / js folders and / Resources folder containing resources. Some seem to overlap as MicrosoftAjax.js is in multiple places (but could there be different versions?). I could also host resources at / DesktopModule / ModuleX location.
Does anyone know if there is a difference in using any of these folders?
I like the idea that all static resources are under a shared folder (/ Resources), so I could set headers, permissions, etc. In one place.
Has anyone used a separate image server for DotNetNuke static content? Pros and cons of a separate image server (like images.mydomain.com)?
a source to share
If you own the entire DNN installation, then it certainly makes sense to consolidate all of your resources in one place (regardless of whether its Resources folder, used by DNN, or another folder that DNN doesn't know about). If you are developing a module that will be installed on a site that you do not fully own, then it is important that you limit your resources in the DesktopModules folder for your module.
Some things to consider regarding DNN folders:
- If you have content in a module folder, removing that module will give you the option to delete that content. It can help you keep it clean and organized, or it can make it dangerous if you have multiple module definitions sharing the same files ... (Even more dangerous can be deleting SQL scripts, make sure you don't accidentally delete module that has a remote script)
- You can use the DNN file manager to upload / delete / rename files in the Portals directory, so it makes sense to put files there if site administrators need to have control over them.
- Placing content outside the module folder will make it difficult to bind (especially if it's in a specific portal folder, meaning you have to query the PortalSettings object for that path every time)
- It is unusual to leave resources outside the module folder, so it can be confusing if you bring an experienced DNN developer to the project
a source to share
For skins and containers, you can use your own folders in the Portals directory. As bdukes says , site admins can manage them within DNN.
For modules, I used the module folder and module.css for the defaults, which can be overridden with a skin or css container. This works because the skin and css container are loaded after module.css.
a source to share