Archive

Archive for July, 2009

Creating custom webpart zones WSS

We’ve had a query appear on the Technet forums where the poster was asking how to create a page in SharePoint with custom webpart zones.  After a fair bit of confusion, I thought I’d create this blog post showing how it’s done (it’s much easier to understand when images can be used)
First up, you need to launch SharePoint Designer 2007 and connect it up to your site.
Now click on File | New | Create from Master Page

newfrommaster

This will then fire up a dialogue box asking for the master page you wish to use.  In this test case, I will simply leave it at the default.master:

wizard

SharePoint Designer will now create a new .aspx page and apply the master page to it.  This can take a few seconds (in my test environment anyway).  Once it has finished, switch to design mode.  We need to look for the PlaceHolderMain region which by default, cannot be modified.  If you mouse over the region, you will note that the cursor icon shows that the region is inaccessible.  We therefore need to allow this (so we can whack in our webpart zones) and we do this by clicking on the menu attached to the right of the region and clicking on the Create custom Content link:

createcc

When you mouse over the PlaceholderMain region, you will now see that we can make some changes.  The first thing we will do is to insert a table to hold our webpart zones.  Click on Table | Insert Table and configure the table according to your needs:

createtable

When you are ready, click OK.  Now that is done, we can start to add our webpart zones.  Click into your first cell and then select Insert | SharePoint Controls | WebPart Zone.  Repeat this for each cell in which you wish to hold a zone:

webpartzone1

Now we can save our page and see how we’ve got on:

save

You can now browse to your new page through Internet Explorer and take a look.  Don’t forget that you will need to click on Site Actions | Edit Page to see the webpart zones!

result

Looking good so far.  Now you can whack in your webparts and your good to go.

Categories: SharePoint Tags: , ,