So how did we do?

Now that we have gotten an introduction to the concepts, lets get into business.

The PowerNodes website is build upon a number of Schemas, Templates and Pages. In this article we are going to concentrate on one single Schema and Template combination, the one we on powernodes.com use for most of our documents.
When we build the website, we chose to call both this Schema and Template "standard". It's a simple combination using only 2 Schema elements.

The "standard" Schema
The standard schema contains 2 elements, a Headline and a Content element.

The "standard" schema

Now that we have our Schema defined, we need to create a HTML Template which matches the standard Schema. These two combined, allows us to create "documents" based on the standard Schema in the FrontDesk application.

But before getting into the Placeholders for rendering Schema elements, let's adapt our standard.aspx Template so it's ready for the CMS implemtation. We already know that we want to use "cms" Placeholders, so we need to register the assembly:

<%@ Page language="c#" %>
<%@ Register TagPrefix="cms" Namespace="PowerNodes.Cms.Web" Assembly="PowerNodes.Cms" %>

Next we need to make sure that CSS, Meta data etc. defined in the FrontDesk application is rendered. For this we need to remove the normal <head> section of our HTML document, and replace it with the PowerNodes Head tag. This also allows us to link to external css, script files etc.

<cms:head runat="server">
<meta content="text/html; charset=iso-8859-1" HttpEquiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="/pn.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/pn_print.css" media="print" />
<script type="text/javascript" src="/pn.js"></script>
</cms:head>

Okay that was easy right? Let's get back to schema definitions and Placeholders for rendering these. We need two Placeholders, one for the Headline element and one for the Content element.
For the Headline element, we use a TextPlaceholder, and for the Content element we use a HtmlPlaceholder:

<cms:TextPlaceholder id="TextPlaceholder1" runat="server" ElementKey="Headline" />

<cms:HtmlPlaceholder id="HtmlPlaceholder1" runat="server" ElementKey="Content" />

Notice the property "ElementKey", this must match the schema elements names.
We now actually have made it possible to create documents in FrontDesk, giving the editor two fields to type content in, the Headline and the Content fields. With the Placeholders in our Template, we have also made it possible for the documents to actual render as webpages.

You should now have a pretty good idea of what this is about, the whole Schema / Template issue. To close this subject, first look at the image of Schema definition above, then look at the Placeholder code we just looked at, and finally on the image below. Do you get it now?

The "standard" schema

In the next section we will get more info other parts of the Template than just Placeholders that render Schema elements. We have Placeholders for rendering menus, lists. etc. you have only dreamed of!

< Back | Contents | Next >