0

I just upgraded my site to Orchard version 1.8. Everything is fine until I use Orchard.Azure to publish to my Cloud Service.

Then the site responds with:

A 'stylesheet' named 'Menus' could not be found.

Menus is the name of the resource bundle in my theme, which is also where the css is located. And is included in the Layout.cshtml by:

Style.Require("Menus").AtHead();

I can remove this error by using Style.Include. But then it won't find the css when running locally.

I didn't have this problem with Orchard 1.7.

The theme project is updated to .NET4.5 and all nessecary steps to convert it to fit Orchard 1.8 are done.

Does anyone have any ideas on how to solve this?

Madelene
  • 970
  • 7
  • 7

1 Answers1

0

Resource bundles in themes don't make a whole lot of sense, unless I'm missing something: resource bundles are for resources that are likely to be re-used across modules, and as such should be defined by modules, not themes.

If you Include using the plain file name of a style sheet under the Styles folder of your theme, it will be found, both locally and deployed.

Style.Include("menus.css")

will work provided the file menus.css is under /Themes/YourTheme/Styles.

As a side note, AtHead is redundant for style sheets as those are never included to the bottom of the page, only in the head. You can remove it.

Bertrand Le Roy
  • 17,731
  • 2
  • 27
  • 33
  • Okey. Thank you for the answer. It solved some issues. But I still have the same problem with the stylesheets defined in a module. – Madelene Apr 22 '14 at 07:14
  • Are you sure you deployed everything you needed to deploy, including the web.çonfig files for the directories where the style sheets and scripts are? – Bertrand Le Roy Apr 23 '14 at 06:15
  • I think that is the problem. Is there any particular settings I should have on the module and on the theme? Do you know? – Madelene Apr 23 '14 at 13:12
  • Just copy a web.config file from another scripts or styles folder, from one of the core modules. – Bertrand Le Roy Apr 23 '14 at 22:14
  • There is something wrong with my module. Can´t figure it out but it is not only related to the styles any more. So I will close this question. Since your answer is still relevant to the question i will mark it as a solution. Thanks for the help. – Madelene Apr 24 '14 at 14:32