Introduction
This is the content type for all the standard sub pages on the site. The layout of a standard sub page is shown in image 1. As you can see, we have a text, an image and an image text. All these fields should be part of the StandardPage content type.
- The body Text for the page
- The right column Image
- The right column Image text

image 1. A standard sub page
This gives us the following properties and data types in our class.
using System;
using System.ComponentModel.DataAnnotations;
using Mindroute.Core.Model;
using System.Collections.Generic;
namespace MyProject.ContentTypes
{
/// <summary>
/// Content type for sub pages
/// </summary>
[Serializable]
[Author("lemoon")]
[Render(Description = "A content type for all standard sub pages.")]
public class StandardPage : StandardContent
{
/// <summary>
/// Right column image
/// </summary>
[Persisted]
[Render(Weight = 1)]
[DataType("File")]
public ContentRef RightColumnImage { get; set; }
/// <summary>
/// Right column image text
/// </summary>
[Persisted]
[Render(Weight = 2)]
[DataType(DataType.Html)]
public string RightColumnImageText {
get;
set;
}
/// <summary>
/// Text
/// </summary>
[Persisted]
[Render(Weight = 3)]
[DataType(DataType.Html)]
public string Text
{
get;
set;
}
}
}
code 1. StandardPage content type class
Create the template for the StandardPage
In order to render the StandardPage correctly, we need to create a template. The template is then connected as the default template for the content type StandardPage. The template should use the site.master master page. Since the content type class is strongley typed, we can inherit the template from the generic Mindroute.Lemoon.Web.UI.PageBase<T> where T is the content type StandardPage. If we do this, we have direct access to the properties in the StandardPage class, for example, RightColumnImageText, Text and so on. Create a template called standardpage.aspx in the \lemoon\template folder. Look at the template below.
<%@ page language="C#" autoeventwireup="true" inherits="MyProject.Template.StandardPage" masterpagefile="~/lemoon/master/site.master" Codebehind="standardpage.aspx.cs" %>
<%@ Import Namespace="Mindroute.Lemoon.Helpers" %>
<asp:content contentplaceholderid="content" runat="server">
<div id="subnavigation">
<ul>
<li><a href="#">Support</a></li>
<li><a href="#">Documentation</a></li>
<li><a href="#">SDK</a></li>
<li><a href="#">References</a></li>
</ul>
</div>
<div id="subcontent">
<div class="post">
<h2 class="title"><a href="#"><% = Content.MenuTitle() %></a></h2>
<p class="date">Posted on <% = Content.Created.ToString("MMMM dd, yyyy") %></p>
<div class="entry">
<% = Content.Text %>
</div>
<div class="meta">
<p class="tags">Tags: <a href="#">Internet</a>, <a href="#">Free Templates</a>, <a href="#">Web Design</a></p>
<p class="links"><a href="#" class="comments">Comments (<% = Content.Comments.Count %>)</a> </p>
</div>
</div>
</div>
<div id="sidebarsub">
<ul>
<li>
<p><img src="<% = Content.RightColumnImage.Value.Url() %>" width="210" height="72" alt="" class="border" /></p>
<% = Content.RightColumnImageText %>
</li>
</ul>
</div>
</asp:content>
code 2. The startpage.aspx template
As you can see in the template code above, the title, text, right column image and right column image text is replaces with content from the currently displayed standard page.
Test the StandardPage content type
Ok, let's test the content type on our site! You need to do the following to test the page
- Enable the StandardPage content type
- Set the default template for a StandardPage to standardpage.aspx
- Create one or more standard pages on the web site
- Browse the site to test the new content type
1. Enable the StandardPage
The content type is created and now we need to enable it before we can use it. Logon to the lemoon editorial interface and go to Manage -> Content types. Click on the StandardPage content type. Check the Enabled checkbox to enable the content type. Once the content type is enabled you can use it on the Site.
NOTE! If the content type isn't visible in the content type list, makle sure you have compiled your project.
2. Set the template
While your're in the edit mode for the content type, set the standardpage.aspx as the template to use for all pages of content type StandardPage.

image 2. Set the template
image 2. Set the templateimage 2. Set the templateimage 2. Set the templateimage 2. Set the templateimage 2. Set the template
3. Create one or more standard pages on the web site
Go to Site and select the page representing the root page on your web site. In this case "Welcome to TerraFirma2". Select the menu Create -> StandardPage. Enter the title "My test page". Select a RightColumnImage to use. If you havn't uploaded any files to the file archive, first go to Files and upload a image to use. Enter a RightColumnImageText and a Text. Click Publish to publish the page.
NOTE! Now might be a good idea to create a top navigation control. The top navigation renders the first level of pages on your site.
Click here to learn more on how to build a top navigation menu
image 3. Top navigation on the site
4. Browse the site
Go to your site and check out the standard page content type in action.

image 4. A standard page example on the public web site