1, download Orchard Sourcrs resource file, also can go to Baidu download Chinese package resource address (https://github.com/OrchardCMS/Orchard/releases/download/1.10/ Orchard.Source.zip) Chinese package address and description (http://www.cnblogs.com/zgqys1980/archive/2012/06/15/2550951.html)
2, unzip the good resource file, in the root directory has build.bin command script file, open can. You can now open the run
3, create the Helloword process.
3.1. Open the Orchard command line. The Orchard command line is in the Orchard.web\bin\orchard.exe position.
3.2, the code Generation is enabled, and then Orchard command line input feature enable orchard.codegeneration. When Orchard.codegeneration is enabled, the module can be created on the command line.
CodeGen Controller <module-name> <controller-name>
Create a Controller class
CodeGen datamigration <feature-name>
Create a list of data files
CodeGen module <module-name> [/includeinsolution:true|false]//codegen module Helloword
Create a module
CodeGen Theme <theme-name> [/createproject:true|false][/includeinsolution:true|false][/basedon:< Theme-name>]
Create a skin
3.3. Add route Routes.cs for module
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using Orchard.Mvc.Routes;
Using System.Web.Routing;
Using SYSTEM.WEB.MVC;
Namespace Mycompany.helloworld
{
<summary>
Define the route used by the module, define the route in orchard to implement the Irouteprovider interface
</summary>
public class Routes:irouteprovider
{
#region Irouteprovider Members
Public ienumerable<routedescriptor> getroutes ()
{
return new[]
{
New Routedescriptor
{
Priority = 5,//precedence (effect is unclear, save for later study)
Route = new route
(
"HelloWorld",//URL pattern of the route.
New RouteValueDictionary//The value to use when the URL does not contain all parameters. The default execution HomeController in the index action.
{
{"Area", "Helloword"},
{"Controller", "Home"},
{"Action", "Index"}
},
New RouteValueDictionary (),//a regular expression that specifies a valid value for the URL parameter.
New RouteValueDictionary {"Area", "Helloword"}},//is passed to the route handler but is not used to determine whether the route matches a specific URL pattern for a custom value. These values are passed to the route handler for processing the request.
New Mvcroutehandler ()//The object that handles the routing request.
)
}
};
}
public void Getroutes (icollection<routedescriptor> routes)
{
foreach (Var routedescriptor in Getroutes ())
{
Routes. ADD (Routedescriptor);
}
}
#endregion
}
}
Orchard Study Notes