Welcome to Shaun Luttin's public notebook. It contains rough, practical notes. The guiding idea is that, despite what marketing tells us, there are no experts at anything. Sharing our half-baked ideas helps everyone. We're all just muddling thru. Find out more about our work at bigfont.ca.

* Orchard CMS Command Line Workflows

Tags: orchard-cms, asp.net-mvc

Last tested on 15 May 2014

First Steps

  • All these commands run from Orchard.Web\bin and require running orchard.exe first.
  • If you cannot find orchard.exe, build Orchard.Web first.

Setup Orchard for First Time Use

Quick and Dirty

setup /SiteName:SITE /AdminUsername:USER /AdminPassword:PASS /DatabaseProvider:SQLCE

Complete Syntax

setup 
  /SiteName:<siteName> 
  /AdminUsername:<username> 
  /AdminPassword:<password> 
  /DatabaseProvider:<SqlCe|SQLServer> 
  /DatabaseConnectionString:<connectionstring> 
  /DatabaseTablePrefix:<tableprefix> 
  /EnabledFeatures:<feature1,feature2,...> 
  /Recipe:<recipe>

Notes

  • You can only run setup once, after which the command is no longer available.
  • You must run setup before any further orchard.exe commands are available.

Create and Activate a New Theme & Turn on Shape Tracing

feature enable Orchard.CodeGeneration
codegen theme My.FirstTheme /CreateProject:true /IncludeInSolution:true /BasedOn:TheThemeMachine
theme activate My.FirstTheme
feature enable Orchard.DesignerTools

If you want to add C# to the theme, be sure to use the CreateProject:true flag.

Package a Theme

package create My_FirstTheme C:\Temp

The theme name is the name of the folder that contains your theme.

Package a Module

package create My_FirstModule C:\Temp

Create and Enable a New Module

feature enable Orchard.CodeGeneration 
codegen module My.FirstModule /IncludeInSolution:true
feature enable My.FirstModule

Add a Data Migration to a Module

codegen datamigration My.FirstModuleTurn on Shape Tracing
feature enable Orchard.DesignerTools