How-To Build a Basic Template

Overview

Please note: This is NOT intended as a guide to writing ASP.Net web forms, C#, HTML or CSS.

SheerCMS uses a system of templates to provide the framework of the page. There can be as many or as few templates as a designer wishes, allowing the page design to be tailored to the content that is to be displayed and they can be as complex or simple as a designer wishes. A SheerCMS template is just a standard ASP.Net 2.0 web form and therefore anything that is supported with ASP.Net 2 can be included.

Creating a basic template

The basic function of a template is to display a specific page definition. This is done using the SheerCMS 'ContentControl' control. To support this a certain amount of structural code is required. Here is an example of the most basic template possible:

Source code for a basic template page.

<%@ Page ... %>
The Page tag is used to define how ASP.Net interprets your .aspx file. The tag above is most basic required for a SheerCMS template. For more information on other parameters that are allowed and what they do, check out Microsoft's MSDN library.
The Inherits="SheerCMS.CMSBasePage" attribute is used to define the base class of the page. All SheerCMS template pages need to be inherit from SheerCMS.CMSBasePage to work properly.

<%@ Register ... %>
In order to make use of the SheerCMS controls provided in the SheerCMSControls DLL it is necessary to register the assembly. The prefix is used before the name of the control in the SheerCMS control tag, it does not need to be "SheerCMSControls", but this is used in the provided templates for clarity.

The "" tag creates the SheerCMS content control that is used to display the requested content. This control can also be used to display Sections or static or programmically generated text. For more information on functionality of the SheerCMS controls and how SheerCMS works internally see the Developer Guide.

The rest of the page is standard ASP.Net page HTML code. Within this template any legitimate HTML, CSS, Javascript or SheerCMS or ASP.Net controls can be added.

This framework, or any page from an example template collection, can be used as a starting point for your own templates.

For a more detailed guide on the functionality of the SheerCMS controls and how SheerCMS works internally see the Developer Guide.