This project is read-only.

Widget CSS

Topics: Customizing Orchard, Troubleshooting, Writing modules
Jul 16, 2011 at 5:14 PM

I cannot for the life of me figure out how to register a CSS stylesheet for my widget. The docs mention Html.RegisterStyleSheet (and also RegisterStylsheet) but these do not exist.

How do you add a stylesheet for your widget, so that the Orchard CMS can make sure there are no duplicates, register the sheet, etc?


Jul 17, 2011 at 10:12 AM
Edited Jul 17, 2011 at 10:14 AM

To add a reference to a stylesheet, near the top of your view add:




You need to make sure that MyStyle.css is in your theme or module's Styles directory. Orchard takes care of making sure that duplicate references are reduced to just one.

If you want to register the stylesheet as a resource that other modules or themes can use, take a look at Orchard.jQuery.ResourceManifest, which registers a number of scripts and styles for global use.

Jul 21, 2011 at 3:28 AM

Thank you very much.