Content-{type,part} Where Best to Create?

Topics: Customizing Orchard, Writing modules
Jun 8, 2013 at 10:21 AM
Greetings,

When creating a version of Orchard for someone, is there any generally accepted wisdom about where to create the content types and parts? I've been doing this in the migrations file, but that's about all there is in the module. After reading a response to an earlier post on workflow, TheMonarch suggested using a custom recipe. At the very end of the documentation on recipes, there's a paragraph on creating a customised distribution of Orchard, but the docs don't seem to give any guidance on where the definition of parts and types should be.

Finally, in the same discussion thread, TheMonarch mentions a way to include actual content as part of the recipe. Does anyone know how that is done? Obviously our content authors and those people creating the content types and parts will be working together, but the people defining content types/parts have probably got enough of a grasp that they can run ahead of the pack a bit. How to keep them organised with the content authors, especially when changing or refactoring existing content types/parts (which already have content), isn't clear to me.

Cheers,
SteveN
Developer
Jun 8, 2013 at 7:04 PM
When creating a module that defines content types and parts, that should generally done in using migration classes, so that they are created upon enabling the feature.

Alternatively, you could create a recipe and distribute that as part of your module. Users can then go to Modules -> Recipes and execute any recipes provided.
Recipes need to be named using the following pattern: myrecipe.recipe.xml.

Recipes can also be used to setup a customized Orchard instance. Such recipes need to be copied to the Recipes folder of the Orchard.Setup module before running Orchard.

Example recipes can be found in Orchard.Setup/Recipes. Simply copy one of them and customize it to your needs. The Blogs and Default recipes should provide sufficient guidance as to where to define content types and parts by example.