VWD-CMS Version 1.0 Documentation

Creating a "Controls" File for Your New Master Page

XML is case-sensitive. For this reason all element names are lower-case and all attribute names are lower-case in the VWD-CMS 1.0 xml configuration files.

VWD-CMS 1.0 Master Pages Need a Controls File

To make sure that the VWD-CMS 1.0 Admin and the Live Site pages work properly, you will need to create Controls (.controls) file to go along with each of your new Master Pages. There needs to be an item in the Controls file for each VwdCms:ContentControl on the MasterPage.

The Controls file tells the MasterPage and ContentControl what type of content the control should render and what folder to find the content file in. Both the rendering of pages on the Live site and the Admin page rely on the Controls file to know how to map content controls to your web pages.

Building Controls files may seem like a pretty complicated task for non-technical people. The good news is that if you only need one Master Page, then you will only need to do this process once. The bad news is that building custom Master Pages, and the Controls files, is not really a job for non-technical people - I recommend that you hire an experienced ASP.NET 2.0 developer if you need to make major changes to the Master Page.

Why is the Controls File Needed?

All web pages have some standard information that the VWD-CMS 1.0 Admin needs to collect and save for each web page that you create. Some examples of these are the Page Title, the Page Description meta tag, and the Keywords meta tag. These standard page properties have been built into the VWD-CMS 1.0 Admin tool already.

In order to allow designers and developers the freedom to create pages however they want and be creative with the layout and features, I don't want to limit in any way how web pages built in VWD-CMS 1.0 are created.

Because of the fact that each Master Page can be completely unique, I have created the Controls file to store the configuration information for a Master Page. When the VWD-CMS 1.0 Admin is running, it reads the Controls file to know what Content Controls are on the Master Page so it can know what information to ask the user to enter.

Similarly, when the web page is requested by a user, the VwdCms.MasterPage (the base class for all pages created with VWD-CMS 1.0) needs to know what information to get from the page's content file and what content control ID to use on the page when it is inserting the content.

Controls File Example

Here is an example. This is the controls file for MainMaster.master (/VwdCms/Master/MainMaster.controls).

<?xml version="1.0" encoding="utf-8"?>
<controls>
<control>
<enabled>true</enabled>
<type>VwdCms.ContentControl</type>
<id>ccPageContent</id>
<folder>Content</folder>
<defaultfile></defaultfile>
<name>Main Content</name>
<description>The main body content of the page.</description>
</control>

<control>
<enabled>true</enabled>
<type>VwdCms.ContentControl</type>
<id>ccBannerLinksLeft</id>
<folder>Navigation</folder>
<defaultfile>Banner-Links-Left</defaultfile>
<name>Left Banner Links</name>
<description>The links on the left side of the banner
(the header section of the page).
</description>
</control>

<control>
<enabled>true</enabled>
<type>VwdCms.ContentControl</type>
<id>ccBannerLinksRight</id>
<folder>Navigation</folder>
<defaultfile>Banner-Links-Right</defaultfile>
<name>Right Banner Links</name>
<description>The links on the right side of the banner
(the header section of the page).
</description>
</control>

<control>
<enabled>true</enabled>
<type>VwdCms.ContentControl</type>
<id>ccNav</id>
<folder>Navigation</folder>
<defaultfile>NavBar</defaultfile>
<name>Navigation Menu</name>
<description>The main navigation menu located on the
left side of the page.
</description>
</control>

<control>
<enabled>true</enabled>
<type>VwdCms.ContentControl</type>
<id>ccAdMain</id>
<folder>Ads</folder>
<defaultfile>AdSense</defaultfile>
<name>Main Ad Space</name>
<description>The main ad space on the page. Located to
the right of the Main Content.
</description>
</control>

<control>
<enabled>true</enabled>
<type>VwdCms.ContentControl</type>
<id>ccAdFooter</id>
<folder>Ads</folder>
<defaultfile>Footer</defaultfile>
<name>Footer Ad Space</name>
<description>The ad space located directly under the Main Content
section and above the Footer.
</description>
</control>
</controls>

This code sample has been automatically colorized by the VwdCms.CodeViewer control, an ASP.NET server control code colorizer that supports HTML, ASPX, XML, C#, and JavaScript code formats.