So, you need a Content Management System on the .NET framework. While your business might spend wheelbarrows of money on a platform that is powerful and extensible, your personal site would abandon extensibility for a free, open-source solution. But what if we had an option that was free and powerful and extensible? We do: Orchard CMS. Since we already know that Orchard is free, in this session we will discuss the power of Orchard’s CMS engine. You will learn how to build new modules for the Orchard platform, allowing you to extend functionality as you see fit to meet the needs of your site, your business, and customers.
2. “
We wanted a modern CMS based on ASP.NET
MVC. We also wanted an extremely extensible
platform similar to what PHP has with Drupal.
But most importantly we wanted to build
better bridges between our team at Microsoft
and the open-source community.
”
Betrand Le Roy, Creator of Orchard
23. Manifest [Module|Theme]
“
A manifest stores metadata that Orchard
uses to describe modules and themes to the
system, such as name, version, description,
author, and tags.
”
docs.orchardproject.net
24. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Name: AntiSpam
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.7.2
OrchardVersion: 1.7.2
Description: Provides anti-spam services to protect your
Features:
Orchard.AntiSpam:
Name: Anti-Spam
Description: Provides anti-spam services to prot
Category: Security
Dependencies: Orchard.Tokens, Orchard.jQuery
Akismet.Filter:
Name: Akismet Anti-Spam Filter
Description: Provides an anti-spam filter based
Category: Security
Dependencies: Orchard.AntiSpam
27. “
The Orchard command interpreter supports
running a few built-in commands as well as
specific commands from enabled features of
an Orchard installation.
”
Orchard.exe
30. orchard> call me "Rock God"
Error executing command "call me Rock God"
---------------------------------------------------------No command found matching arguments "call me Rock God".
Commands available: site setting set baseurl, autoroute
create, theme list, theme activate, widget create, layer
create, menuitem create, menu create, blog create, blog
import, ...
55. orchard> codegen datamigration SlideShare
Creating Data Migration for SlideShare
Data migration created successfully in Module SlideShare
orchard> _
57. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System.Data;
using Orchard.Data.Migration;
namespace SlideShare {
public class Migrations : DataMigrationImpl {
public int Create() {
// Creating table SlideShareRecord
SchemaBuilder.CreateTable("SlideShareRecord",
table => table
!!!!
.ContentPartRecord()
!!!!
.Column("SlideShareId", DbType.String)
!!!!
.Column("StartFromSlide", DbType.Int32)
);
return 1;
}
}
}
58. 11
12 !!!!
13 !!!!
// column methods can use generic types...
.Column<string>("SlideShareId")
.Column<int>("StartFromSlide")
11
12 !!!!
13 !!!!
// or they can use a DbType argument.
.Column("SlideShareId", DbType.String)
.Column("StartFromSlide", DbType.Int32)
// either way. just not both.
59. 5
6
public class Migrations : DataMigrationImpl {
public int Create() {
// The ‘return’ is for versioning
return 1;
14
15
16
}
public int UpdateFrom1() {
// Do some data migrations
return 2;
}
public int UpdateFrom2() {
// More data migrations
return 3;
}
25
26
27
33
34
35
}
60. Attachable [Content Part]
“
Indicates if administrators can attach the
Content Part to any Content Type, or if the
Part is limited only to Types explicitly
specified by the Module.
”
65. Part Handlers
“
Most Handlers will be very simple behavior
managers. Often, the only behavior they will
have to specify is how data is to be stored.
”