0
votes

I'm creating a theme for Orchard CMS 1.10. I'm using a Bootstrap template as a basis. There are quite a number of CSS and JavaScript files that I'm including. All of them however are not being found.

I created a ResourceManifest class to define them:

manifest.DefineScript("ThemejQuery").SetUrl("~/Scripts/plugins/jquery-1.11.3.min.js");
manifest.DefineScript("Bootstrap").SetUrl("~/Scripts/plugins/bootstrap/js/bootstrap.min.js").SetDependencies("ThemejQuery");
manifest.DefineScript("jQueryScrollTo").SetUrl("~/Scripts/plugins/jquery-scrollTo/jquery.scrollTo.min.js").SetDependencies("ThemejQuery");
manifest.DefineScript("BackToTop").SetUrl("~/Scripts/plugins/back-to-top.js").SetDependencies("ThemejQuery");

and am calling them so in my Document.cshtml:

Script.Require("jQuery").AtFoot();
Script.Require("Bootstrap").AtFoot();
Script.Require("jQueryScrollTo").AtFoot();
Script.Require("BackToTop").AtFoot();

In each directory that these css and js files reside, I'm including a web.config file to allow access:

Visual Studio 2013 Solution Explorer

the web.config files all look like:

enter image description here

and yet none of these files are being served. I don't believe that the paths are an issue, e.g. using '~/Scripts'. The paths are correct (as far as I can see):

enter image description here

I've googled the hell out of this but cannot find a solution. I've tried running this within IIS Express in Visual Studio as well as full-blown IIS. Any ideas?

2

2 Answers

2
votes

You need to change the addHandler of your web.config (inside Scripts or Styles) addHandler like:

<add name="StaticFileHandler" path="*" verb="*" modules="StaticFileModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
0
votes

Drop the '~/Scripts', the resource manager looks for scripts in the modules 'Script' folder and for styles in the 'Styles' folder.