2014-05-12

Introduce the Problem

I would like to implement the Orchard IShapeTableProvider, in order to add an alternate for the main List shape. I have done the following:

Download Orchard.Source.1.8.zip, build in VS 2013, and create a new theme via code generation:

Add the following code to my theme in the Themes > My.FirstTheme > Code > ListShapeProvider.cs file.

Clean and build the Orchard solution, then debug Orchard.Web. The debugger does not hit System.Diagnostics.Debugger.Break().

Search and Research

I have read Orchard shapeshifting by Orchard's Benevolent Dictator.

Further, I have installed, built, and run the Contoso theme as an example implementation of IShapeTableProvider. The implementation of IShapeTableProvider is in the ContentShapeProvider.cs file. The Contoso theme also includes a Contoso.csproj file that has the ContentShapeProvider.cs file as a Compile Item.

The new theme that I created does not have a .csproj file. I think the missing .csproj file explains why my ListShapeProvider.cs breakpoint is not executing.

Should I create a .csproj file for my theme? Is there another recommended way to include C# in the theme? For instance, should I use an App_Code folder?

Show more