AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers
URL:
http://aspalliance.com/articleViewer.aspx?aId=1033&pId=-1
Creating WSS Templates
page
by Ameet Phadnis
Feedback
Average Rating: 
Views (Total / Last 10 Days): 30661/ 37

Introduction

I have been getting many queries on how to create WSS Templates after my initial article about SharePoint Templates.  You can view the SharePoint Templates information here.  Some readers thought that creating WSS Templates was going to be similar to SharePoint Templates. Actually there is a difference; this is why I am writing about it.  This article will deal with how to create Themes and how to create Templates.

Themes in WSS Site

The basic way to change the look and feel on the WSS Site is by using Themes. The designer can use the following steps to change the theme in the WSS Site.

·         Click on Site Settings.

·         Under Customization, Click on Apply Theme to Site.

Figure 1

·         Click on the appropriate Theme from the list.

Figure 2

·         You will see the image of the theme just above Preview.

·         Click Apply.

So, how does WSS pick up the theme information?  Again, as explained in my SharePoint Templates article, most of it is taken from the file system.  The SharePoint files are stored under C:\Program Files\Common Files\Microsoft Shared\web server extensions\60.

Under this folder there is a folder called TEMPLATE and underneath this folder there is a folder called Themes.

If you look at the folder structure for Themes, you will notice that all the Themes have individual folders under the Themes folder (Figure 2).

For this example, I am going to create my own theme from an existing theme named Afternoon.  You can use Paintshop or another graphic tool to do all your graphics.

Steps to create your own theme:

·         Copy the Afternoon folder and paste it to the Themes folder.

·         Rename Copy of AFTRNOON folder to AMEETTHEME.

·         Double click on the AMEETTHEME folder.

·         Rename all the file names that reference Afternoon in the name to Ameettheme.

·         Open the AMEETTHEME.INF file and change the title from Afternoon to AmeetTheme.

·         We need some way of informing WSS that a new theme has been added.  As you might have noticed in my previous article, SharePoint uses a lot of XML files to keep track of templates and lists.  In this scenario it is the same.  We need to modify the SPTHEMES.XML file.  Here is the twist on the location of this file.  When I started researching WSS templates, I thought the file would be somewhere in the Themes folder, but I found it under C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033.

·         In the SPTHEMES.XML file, copy the Afternoon section and create a new XML section as follows.

<Templates>
  <TemplateID>ameettheme</TemplateID>
  <DisplayName>Ameet Theme</DisplayName>
  <Description>Description</Description>
  <Thumbnail>../images/thanoon.png</Thumbnail>
  <Preview>../images/thanoon.gif</Preview>
</Templates>

·         After the above steps are done, you have to do an IISRESET.

·         Run the WSS Site in your browser and then go to Apply Themes to Web Site page.  You should now be able to see the new Theme you created.  In my scenario I have Ameet Theme listed.

Figure 3

In the above section I explained the simplest way of changing the look and feel for your website.  In the next section I will explain how you can completely modify the main page with new graphics.

WSS Template

Whenever you create a new Team Site you are presented with a Template Selection Page and you see all the Templates that are uploaded to the server.  Your screen will look somewhat like the following.

Figure 4

In the above example you will notice that I have already created a few Templates.  Initially, the users might guess that these new templates are coming from some files or XML Files. But actually with Team Sites it is coming from the database.  It is not recommended to go and customize the WSS databases.  However, for this example I will just let you know that the Templates are stored in CustomTemplates table in your config database.  Explaining the database structure is beyond the scope of this article.

Steps to create your own WSS Template

·         Initially, you can start with predefined templates.  I will start with Team Site Template.

·         As soon as your site is created, it will display the web parts and layout for that particular template.  In my scenario, it will display as Figure 5.

Figure 5

Make as many changes as you want on this screen.  I am going to do the following changes:

·         Remove the Windows Share Point Services Logo and Announcements.

·         Add the Document Library Web Part.

·         Add the Contact Web Part.

·         My Final WSS Site will look like the following.

Figure 6

·         Now, I will also change the Theme for this site.

·         I am going to select the Compass Theme from the Apply Theme to Web Site Page.  

Figure 7

You can also make more design changes by opening this page in Front Page 2003.  As you might have found out, Front Page 2003 is tightly integrated with SharePoint.  In order to edit with Front Page 2003, follow these steps.

·         Click on File.

·         Select Edit With Microsoft Office FrontPage.

·         FrontPage 2003 will open with your page and also with the complete site navigation in it.

·         Make any necessary changes in FrontPage.  The FrontPage features with SharePoint are beyond the scope of this article.

·         For this example I am going to add a new Zone at the top called Top Zone.  I will follow these steps to add the new zone to it.

·         Select the row with Left and Right zones.

·         Select Table and Select Insert -> Rows or Columns.

·         The following dialog box displays.

Figure 8

·         In this window make sure the Rows radio button is selected.

·         In Location select the Above Selection option.

·         Keep the Number of Rows to 1.

·         Click OK.

·         The row is then inserted.

·         Now highlight the complete row and select Table -> Merge Cells.

·         The columns will merge.

·         Now make sure that your cursor is in the newly added row.

·         Select Data Menu.

·         Under Data Menu select Insert Web Part Zone.

Figure 9

·         The Web Part Zone is added to the newly created Row.  Your screen should look like the one below.

Figure 10

·         Now we need to set the property for the Web Part Zone.

·         Select the Web Part Zone, right click on it and select Web Part Zone Properties.

Figure 11

·         Give a suitable Title to Zone Title Property; keep the remaining properties the same.  I am going to name it Top Zone.

·         Click OK.

·         Now your Top Web Part Zone is ready to be used.

·         Save the Page.

·         Refresh your web page in IE.  Your page should look like following in design mode.

Figure 12

·         Now let us add the Content Editor Web Part to the Top Zone.

Figure 13

·         Now I am done with my changes.  I need to export this site as a template to be used next time when creating similar sites.

·         To save this site as a template follow these steps.

·         Click on Site Settings.

·         Under Administration, click Go to Site Administration.

·         Under Management and Statistics, click Save Site as Template.

·         The Save Site as Template screen is displayed.

Figure 14

·         Enter a Suitable name to the file name, template title and description; if you wish, you can also include the content created on this site.

·         Click OK.

·         Upon successful completion you should get an Operation Completed Successfully page.

Figure 15

·         Now we need to save this file to our local machine.  Follow these steps to save the stp file.

·         Click on the Site Template Gallery link in the above image.

·         The site template gallery screen displays as follows.

Figure 16

·         Right Click on the template and select Save Target As.

·         In the Save As box, select the folder where you would like to save the template.

·         The template has been saved to your local drive.

In this section we saw how we can create a WSS Template.

Deploying the Template to the server

Now we have created a new template.  The next task is to deploy it to the server.  This task is very easy.  On the server follow these steps.

·         Open Command Prompt and type in the following syntax:

stsadm.exe -o addtemplate -filename <template filename>
 -title <template title> [-description <template description>.]

·         I am going to type it as

""C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN\STSADM.exe" 
-o addtemplate -filename "C:\Articles\AmeetArticle.stp" -title "Ameet Article"
 -description "This article explains how to create Templates." ".

·         Once the operation is completed successfully, you have to do an IISReset.

With these steps we have deployed the template to the server.  The next step will involve using this template.  You are already familiar with how to create a WSS Site.  Once you create your WSS site on the Template Selection screen, you should see the newly created template.

 

Figure 17

When the site is created it will be similar to the design you created.  My new WSSDeploy site looks like the one below.

Figure 18

Summary

In this article I explained how easy it is to create your own themes and your own WSS Templates.  You can create these templates for your business needs and use it for your company's team sites.  On Microsoft's site there are some templates that can be downloaded.  You can find them at http://www.microsoft.com/technet/windowsserver/sharepoint/wssapps/default.mspx.


Product Spotlight
Product Spotlight 

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-19 1:58:06 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search