Home > WSS Customisation > Custom Web Part Pages in WSS (Part 2)

Custom Web Part Pages in WSS (Part 2)

Following on from Part 1, we will create a custom content type for a Web Part Page for use in a Pages library that supports versioning and is able to be crawled by WSS Search…

Creating a new Site Column

The page body for the custom web part page is to come from a new custom site column, imaginatively called Page Body.  This should be configured to be of type Multiple lines of text and allow Enhanced rich text as shown below:

Create a new Site Column called Page Body

Note: the Allow unlimited length in document libraries option must be set to Yes.

Creating a new Content Type

The next step is to create a new Custom Web Page content type to be used for the custom web part page; this content type will allow for the page’s content to be stored within the page rather than in a web part:


Create a new Document Library

Add a new Document Library to the WSS site; use Web Part Page as the document template and ensure that versioning is switched on:  


Once this has been created, update the document library settings to use content types via the Advanced settings page.  

Then add the Custom Web Page content type to the library:


On the document library settings page,  click on the link for the Custom Web Page content type to open the List Content Type configuration page.   Add the Page Body site column using the Add from existing site of list columns link:


Finally, remove the default Document content type from the list of content types for the library.

As this point the document library settings should look like this:


Update the WSS Web Part Page templates

The final step to complete is to update the WSS Web Part Page templates to make use of the new Page Body column and display the content.  

To do this, simply add the following code to the template in the location you want the content to be displayed, e.g. within the content area with ContentPlaceHolderId=”PlaceHolderMain”:

  <td class="ms-pagebody" colspan="3" valign="top" width="100%">
    <SharePoint:ListItemProperty Property="Page_x0020_Body" runat="server"/>

Of course nothing is ever *that* simple.

WSS ships with eight Web Part Page templates located in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\STS\DOCTEMP\SMARTPGS folder.  These files, named spstd1.aspx through spstd8.aspx cannot be renamed as they are used by the spcf.aspx page which serves as the document template for Web Part Pages.

Note: if you edit these templates you will be editing them for all Web Part Pages on that server, so bear this in mind.

Alternatively, create a new page template and associate it with the Custom Web Page content type created earlier.  This is done by specifying a new document template to replace spcf.aspx: open the content type definition for Custom Web Page, select Advanced Settings and then enter the location of the new document template:

Apply Custom Document Template

The new document template must replicate the features of spcf.aspx, i.e. create a new instance of the page template.  

In WSS 3.0, the functionality for this has been moved from embedded code in the aspx page to the owssvr.dll assembly.  Unfortunately this assembly expects the page templates to be named spstd1.aspx through spstd8.aspx.  So you’re left with editing the default pages or attempting to replicate the entire functionality yourself.  

Apparently it is possible to make use of a file written for WSS 2.0 to do this.  Instructions are to be found on MSDN here.  Ignore references to editing create.aspx; we’ve already associated the custom document template with the content type.  Just follow instructions 1 through 6 in the Adding a new Template section.

Using the Custom Web Part Page

Use the Create buttom on the document library task bar as normal.  Select the Web Part Page layout from the standard eight available with WSS.  

To add HTML content to the page, use the context menu for the page to select Edit Properties …


…and then enter content into the Page Body field:

Edit the Page Body field to enter HTML content

The Page Body field will be rendered as HTML on the page:

New Custom Web Part Page

Any HTML content added to the Page Body field will be versioned…


…and crawled for searching via the standard WSS Search.

Install and Configure Telerik RadEditor for MOSS Lite Edition

Whilst not necessary to provide versioned and searchable pages, the RadEditor is recommended as a superior HTML editor.  If deployed, ensure that the RadEditor feature is enabled for list items:


The Lite Edition of the RadEditor for MOSS can be downloaded free of charge from Telerik.

  1. MichaelM
    December 30, 2008 at 6:11 pm

    Interesting post.
    I have a question though, how is the HTML from the Page Body column actually displayed on the page?

    • oidatsmyleg
      January 22, 2009 at 9:29 am

      Excellent point, I missed out a rather vital step and for this I can only apologise. I’ve updated the post to rectify this omission.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: