N2 is a lightweight CMS framework that helps you build great web sites that anyone can update. Web content editors can enjoy a simple and enpowering web interface. Developers will benefit from a programmer friendly API that makes building web sites quick and fun. N2 is focused on removing redundant steps when working with content types and ASPX templates. All of development is done within visual studio.

Project home page and more information at n2cms.com

Declarative definition of content types

The code snipped shows what you need to define an editable page with a WYSIWYG text editor. The type is picked up by the N2 engine at runtime and made available to editors. Other extension points are available when you need more, e.g. extension of the content model using inheritance, constraints, user defined editors and replacements of core services.

[Definition, Template("~/my/pageitemtemplate.aspx"]
public class PageItem : N2.ContentItem
{
	[EditableFreeTextArea("Text", 100)]
	public virtual string Text
	{
		get { return (string)GetDetail("Text"); }
		set { SetDetail("Text", value); }
	}
}

Templates and data binding utilities

N2 doesn't interfere with with the end user interface (the HTML) and provides some nice data binding utilities to make life easier when using ASP.NET.

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" />

Friendly API

N2 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);
}

Easy to use editor interface

N2 is bundled with a simple 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.

EditInterface1_4_4.jpg
Last edited Jan 7 at 9:25 PM by libardo, version 14

 

Want to leave feedback?
Please use Discussions or Reviews instead.

Archived page comments (14)

Updating...
© 2006-2009 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Version 2009.6.1.15196