This project is read-only.

Ressource Module

Topics: Writing modules
Aug 5, 2011 at 9:23 AM

I tried to create a Ressource Module like the Jquery one.

I Added some css Styles in the RessourceManifest.

Now i want to use them in other modules, as of yet no success.

I set a breakpoint to the BuildManifests and found out that its hit, later than my "@{ Style.Require}

is this the problem maybee ?

Has anybody a hint how to resolve this issue?



Aug 5, 2011 at 11:39 AM

Post your ResourceManifest and the code for your View - it's hard to debug without something to debug.

Aug 5, 2011 at 11:53 AM

this it the module Global

using Orchard.UI.Resources;

namespace Global.Ressources
    public class ResourceManifest : IResourceManifestProvider {
        public void BuildManifests(ResourceManifestBuilder builder) {
            var manifest = builder.Add();


this is the other module which should consume it:


@using Orchard.ContentManagement;
@using Orchard.UI.Resources;
@{ Style.Require("specialcss"); }


throws A 'stylesheet' named 'specialcss' could not be found

Aug 5, 2011 at 12:01 PM

Is special.css definitely in the Styles folder for your Global module?

Orchard.jQuery seems to set the version on all the items added to the builder, that might effect it somehow, e.g.:


Although having said that, it isn't set for the jQuery TimePicker CSS and that works.

Does your module specify your resources module as a dependency in Module.txt?

Aug 5, 2011 at 12:30 PM

okay it corrected dependencies! and never forget renaming a module after creation is veryyyyy bad !!!


now it works THANK YOUUU