Welcome to N2CMS

N2CMS is a lightweight CMS framework. With just a few strokes of your keyboard a wonderful strongly-typed model emerges complete with a management UI. You can spend the rest of your day building the best site imaginable.

It's so .NET! With N2CMS, you build the model of the data that needs to be managed using C# or VB code in Visual Studio. The type below is picked up by the N2 engine at runtime and made available to be edited. The code uses an open API with multiple built-in options and unlimited customization options.

All you have to do is design your model class (inherit N2.ContentItem) and define which properties are editable by adding attributes

[PageDefinition(TemplateUrl = "~/my/pageitemtemplate.aspx")]
public class PageItem : N2.ContentItem
{
    [EditableFreeTextArea]
    public virtual string Text { get; set; }
}

Quick Start

For a quick start, follow these instructions, which assume that you are using ASP.NET MVC + Razor (the "Dinamico" template pack -- see below).

1. Create a new, empty Web Application Project in Visual Studio 2012 or 2013.
2. Go to Tools > Library Package Manager > Package Manager Console
3. In the Package Manager console run the following commands:

Install-Package N2CMS.Dinamico
Install-Package N2CMS.Management

Please note, N2CMS supports the following ASP.NET view engines:
  • ASP.NET MVC + Razor ("Dinamico" template pack)
  • ASP.NET MVC + MVC Views ("MVC" template pack)
  • ASP.NET Web Forms
Detailed installation instructions are available at: https://github.com/n2cms/n2cms/blob/master/README_SETUP.md

or in our documentation wiki: https://n2cmsdocs.atlassian.net/wiki/display/N2CMS/Getting+Started+using+N2CMS

"I never thought getting the data out again could be so easy"

N2 CMS knows not to mess with YOUR HTML. For web-forms it provides a nice data binding controls, and for ASP.NET MVC routes to your controller and provides easy access to data.
Binds a control to the current page's text property: 
<asp:Literal Text="<%$ CurrentItem: Text %>" runat="server" />

Provides create, read, update, delete access to content through ASP.NET the databinding API:
<n2:ItemDataSource ID="Level1Items" runat="server" Path="/" />
<asp:DataGrid DataSourceID="Level1Items" runat="server" />

Renders non-page items added to the "RightColumn" zone:
<n2:Zone ZoneName="RightColumn" runat="server" />

Outputs content using the default control (a literal in this case):
<n2:Display PropertyName="Text" runat="server" />

"This API is my friend"

N2 CMS not only makes the content manageable by non-techies, it also makes it easy to find and do stuff with content programmatically.
public void DoSomeStuffWithSomeItems(DateTime minDate, DateTime maxDate)
{
	IList<ContentItem> items = N2.Find.Items
		.Where.Created.Between(minDate, maxDate)
		.And.SavedBy.Eq("admin")
		.OrderBy.Published.Desc
		.Select();

	foreach (ContentItem item in items)
		DoSomethingWith(item);
}

"I just know what to do with this"

N2 is bundled with a usable editor interface that allows (among other things) editing, organization, moving, exporting and importing of content. Virtually no administration or configuration is required. To further simplify usage you can create plug ins.
user_friendly_interface_2_0.png

Last edited Mar 18 at 11:25 PM by bherila, version 28