Zephyr's SharePoint Blog

My Sharepoint world experience notes on day to day basis…..

Archive for October, 2008

Creating a Custom Site Definition

Posted by fillzephyr on October 17, 2008

This whole credit is Going to My Friend
ALKESH who had documented this things so that other people  can Utilize it.
Thanks
ALKESH for this wonderful work.
Creating a Custom Site Definition
Base Site : Team Site
Tools : Studio
Before we start, let’s have some basic understanding. There are 2 files important for creation of Site Definition. 1. ONET.XML 2. WEBTEMP.XML
Onet.xml
When you install Windows SharePoint Services 3.0, six Onet.xml files are placed within the setup directory, one in \Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\GLOBAL\XML that applies globally to the deployment, and each in different folders within ...\TEMPLATE\SiteTemplates that apply to each of the site definitions that ship with Windows SharePoint Services 3.0.
The global Onet.xml file defines list templates for hidden lists, list base types, a default definition configuration, and modules that apply globally to the deployment. The rest Onet.xml files in the \SiteTemplates directory define navigational areas, list templates, document templates, configurations, modules, components, and server e-mail footer sections used in the site definitions.

Functions of Onet.xml

Depending on its particular use, an Onet.xml file can serve multiple functions, such as the following:
· Define the top and side navigation areas that appear on the home page and in list views for a site definition.
· Specify the list definitions that are used in each site definition and whether they are available for creating lists on the Create page.
· Specify document templates that are available in the site definition for creating document library lists on the New page, and specify the files used in the document templates.
· Define the base list types from which default Windows SharePoint Services lists are derived. (Only the global Onet.xml file serves this function.)
· Specify the configurations of lists and modules that are used within each site definition.
· Specify Windows SharePoint Services components.
· Define the footer section used in server e-mail.

Web Site Definition Tasks with Onet.xml

The following kinds of tasks can be performed in a custom Onet.xml to create a custom site definition:
· Specify an alternate cascading style sheet (CSS) file, JavaScript file, or ASPX header file for a site definition.
· Modify navigation areas for the home page and list pages.
· Add a list definition as an option to the Create page.
· Add a document template for creating document libraries.
· Define one or more configurations for the site definition, specifying the lists, modules, files, and Web Parts that are included when a site definition configuration is instantiated.
WebTemp.xml
Each front-end Web server in a deployment of Windows SharePoint Services has at least the originally installed WebTemp.xml file located in the Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\1033\XML folder. There may also be one or more custom WebTemp*.xml files. The WebTemp*.xml files contain the site definition configurations that are available on the Template Selection section of the New SharePoint Site page.
OK Let’s Start… (If you don’t want to go step by step you can always put the attached folder in your SITETEMPLATE folder and run the project from there)
The following section outlines the steps necessary to create a custom Site Definition by copying one of the existing ones and modifying it to suit your needs. For this exercise you will use the Team Site (sts) Site Definition as a starting point.
You will be using Visual Studio 2005 to develop your custom Site Definition.
  1. Create a new project in Studio by clicking Project under the New option from the File menu.
  2. Under Project types, select the Class Library template under Windows in the language of your choice.
 
Note
We are using a Class Library project type, so that you will always get a project that compiles, thus enabling you to run post-build scripts.
  1. In the Location text box browse to [WSS]\TEMPLATE\SiteTemplates and click Open. By placing the project here, most files will already be where they need to be for the Site Definition to function. You will use a post-build script to move any files that need to be located elsewhere to their final location.
  2. Uncheck the Create directory for solution check box.
  3. Give your Site Definition a meaningful name such as MySiteDefinition, and click OK.
     
  1. Delete the Class1.cs file. It is not needed.
  2. Create an XML folder by right-clicking on the project node and selecting New Folder from the Add context menu.
  3. Add an New Item by right-clicking on the XML folder and selecting XML file. Name it as onet.xml
Copy the following code in onet.xml file:
<?xml version=1.0?>
<Project Title=$Resources:onet_TeamWebSite; Revision=2 ListDir=$Resources:core,lists_Folder; xmlns:ows=Microsoft SharePoint xmlns=http://schemas.microsoft.com/sharepoint/>
<!– _filecategory=”SiteDefinition” _filetype=”Schema” _filename=”onet.xml” _uniqueid=”1dd64126-2d25-4395-9508-db2a22aca8c8″ –>
<!– _locID@Title=”camlidonet1″ _locComment=”{StringCategory=HTX}” –>
<NavBars>
<NavBar Name=$Resources:core,category_Top; Separator=&amp;nbsp;&amp;nbsp;&amp;nbsp; Body=&lt;a ID=’onettopnavbar#LABEL_ID#’ href=’#URL#’ accesskey=’J’&gt;#LABEL#&lt;/a&gt; ID=1002/>
<NavBar Name=$Resources:core,category_Documents; Prefix=&lt;table border=0 cellpadding=4 cellspacing=0&gt; Body=&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src=’/_layouts/images/blank.gif’ ID=’100′ alt=” border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href=’#URL#’&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; Suffix=&lt;/table&gt; ID=1004/>
<NavBar Name=$Resources:core,category_Lists; Prefix=&lt;table border=0 cellpadding=4 cellspacing=0&gt; Body=&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src=’/_layouts/images/blank.gif’ ID=’100′ alt=” border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href=’#URL#’&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; Suffix=&lt;/table&gt; ID=1003/>
<NavBar Name=$Resources:core,category_Discussions; Prefix=&lt;table border=0 cellpadding=4 cellspacing=0&gt; Body=&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src=’/_layouts/images/blank.gif’ ID=’100′ alt=” border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href=’#URL#’&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; Suffix=&lt;/table&gt; ID=1006/>
<NavBar Name=$Resources:core,category_Sites; Prefix=&lt;table border=0 cellpadding=4 cellspacing=0&gt; Body=&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src=’/_layouts/images/blank.gif’ ID=’100′ alt=” border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href=’#URL#’&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; Suffix=&lt;/table&gt; ID=1026/>
<NavBar Name=$Resources:core,category_People; Prefix=&lt;table border=0 cellpadding=4 cellspacing=0&gt; Body=&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src=’/_layouts/images/blank.gif’ ID=’100′ alt=” border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href=’#URL#’&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; Suffix=&lt;/table&gt; ID=1027/>
</NavBars>
<ListTemplates>
</ListTemplates>
<DocumentTemplates>
<DocumentTemplate Path=STS Name=“” DisplayName=$Resources:core,doctemp_None; Type=100 Default=FALSE Description=$Resources:core,doctemp_None_Desc;/>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_Word97; Type=101 Default=TRUE Description=$Resources:core,doctemp_Word97_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\word\wdtmpl.doc TargetName=Forms/template.doc Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_Excel97; Type=103 Description=$Resources:core,doctemp_Excel97_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\xl\xltmpl.xls TargetName=Forms/template.xls Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_Powerpoint97; Type=104 Description=$Resources:core,doctemp_Powerpoint97_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\ppt\pptmpl.pot TargetName=Forms/template.pot Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_Word; Type=121 Default=TRUE Description=$Resources:core,doctemp_Word_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\word\wdtmpl.dotx TargetName=Forms/template.dotx Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_Excel; Type=122 Description=$Resources:core,doctemp_Excel_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\xl\xltmpl.xlsx TargetName=Forms/template.xlsx Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_Powerpoint; Type=123 Description=$Resources:core,doctemp_Powerpoint_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\ppt\pptmpl.pptx TargetName=Forms/template.pptx Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_OneNote; Type=111 Description=$Resources:core,doctemp_OneNote_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\onenote\template.one TargetName=Forms/template.one Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_FP; Type=102 Description=$Resources:core,doctemp_FP_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\fp\fptmpl.htm TargetName=Forms/template.htm Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_BasicPage; Type=105 Description=$Resources:core,doctemp_BasicPage_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\blankpgs\_basicpage.htm TargetName=Forms/_basicpage.htm Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate Path=STS DisplayName=$Resources:core,doctemp_WebPartPage; Type=106 Description=$Resources:core,doctemp_WebPartPage_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\smartpgs\_webpartpage.htm TargetName=Forms/_webpartpage.htm Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
<DocumentTemplate XMLForm=TRUE Path=STS DisplayName=$Resources:core,doctemp_BlankForm; Type=1000 Default=TRUE Description=$Resources:core,doctemp_BlankForm_Desc;>
<DocumentTemplateFiles>
<DocumentTemplateFile Name=doctemp\xmlforms\blank\template.xml TargetName=Forms/template.xml Default=TRUE/>
</DocumentTemplateFiles>
</DocumentTemplate>
</DocumentTemplates>
<Configurations>
<Configuration ID=0 Name=Default CustomMasterUrl=_catalogs/masterpage/LyoSalesPortalSD.master MasterUrl=_catalogs/masterpage/LyoSalesPortalSD.master>
<Lists>
<List FeatureId=00BFEA71-E717-4E80-AA17-D0C71B360101 Type=101 Title=$Resources:core,shareddocuments_Title; Url=$Resources:core,shareddocuments_Folder; QuickLaunchUrl=$Resources:core,shareddocuments_Folder;/Forms/AllItems.aspx/>
<List FeatureId=00BFEA71-6A49-43FA-B535-D15C05500108 Type=108 Title=$Resources:core,discussions_Title; Url=$Resources:core,lists_Folder;/$Resources:core,discussions_Folder; QuickLaunchUrl=$Resources:core,lists_Folder;/$Resources:core,discussions_Folder;/AllItems.aspx EmailAlias=$Resources:core,discussions_EmailAlias;/>
<List FeatureId=00BFEA71-D1CE-42de-9C63-A44004CE0104 Type=104 Title=$Resources:core,announceList; Url=$Resources:core,lists_Folder;/$Resources:core,announce_Folder;>
<Data>
<Rows>
<Row>
<Field Name=Title>$Resources:onetid11;</Field>
<Field Name=Body>$Resources:onetid12;</Field>
<Field Name=Expires>&lt;ows:TodayISO/&gt;</Field>
</Row>
</Rows>
</Data>
</List>
<List FeatureId=00BFEA71-2062-426C-90BF-714C59600103 Type=103 Title=$Resources:core,linksList; Url=$Resources:core,lists_Folder;/$Resources:core,links_Folder;/>
<List FeatureId=00BFEA71-EC85-4903-972D-EBE475780106 Type=106 Title=$Resources:core,calendarList; Url=$Resources:core,lists_Folder;/$Resources:core,calendar_Folder; QuickLaunchUrl=$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;/Calendar.aspx EmailAlias=$Resources:core,calendar_EmailAlias;/>
<List FeatureId=00BFEA71-A83E-497E-9BA0-7A5C597D0107 Type=107 Title=$Resources:core,taskList; Url=$Resources:core,lists_Folder;/$Resources:core,tasks_Folder; QuickLaunchUrl=$Resources:core,lists_Folder;/$Resources:core,tasks_Folder;/AllItems.aspx/>
</Lists>
<Modules>
<Module Name=DefaultMasterPage/>
<Module Name=ModuleCool></Module>
</Modules>
<SiteFeatures>
<!– BasicWebParts Feature –>
<Feature ID=00BFEA71-1C5E-4A24-B310-BA51C3EB7A57/>
<!– Three-state Workflow Feature –>
<Feature ID=FDE5D850-671E-4143-950A-87B473922DC7/>
</SiteFeatures>
<WebFeatures>
<Feature ID=00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5/>
<!– TeamCollab Feature –>
<Feature ID=F41CC668-37E5-4743-B4A8-74D1DB3FD8A4/>
<!– MobilityRedirect –>
</WebFeatures>
</Configuration>
</Configurations>
<Modules>
<Module Name=DefaultMasterPage Url=“” Path=“”>
<File Url=default.aspx NavBarHome=True>
<View List=$Resources:core,lists_Folder;/$Resources:core,announce_Folder; BaseViewID=0 WebPartZoneID=Left/>
<View List=$Resources:core,lists_Folder;/$Resources:core,calendar_Folder; BaseViewID=0 RecurrenceRowset=TRUE WebPartZoneID=Left WebPartOrder=2/>
<AllUsersWebPart WebPartZoneID=Right WebPartOrder=1>
<![CDATA[
<Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ImageWebPart</TypeName>
<FrameType>None</FrameType>
<Title>$Resources:wp_SiteImage;</Title>
<iwp:ImageLink>/_layouts/images/homepage.gif</iwp:ImageLink>
<iwp:AlternativeText>$Resources:core,sitelogo_wss;</iwp:AlternativeText>
</WebPart>
]]>
</AllUsersWebPart>
<View List=$Resources:core,lists_Folder;/$Resources:core,links_Folder; BaseViewID=0 WebPartZoneID=Right WebPartOrder=2/>
<NavBarPage Name=$Resources:core,nav_Home; ID=1002 Position=Start/>
<NavBarPage Name=$Resources:core,nav_Home; ID=0 Position=Start/>
</File>
</Module>
<Module Name=Pages Url=“”>
<File Url=default.aspx NavBarHome=True>
<View List=$Resources:core,lists_Folder;/$Resources:core,announce_Folder; BaseViewID=0 WebPartZoneID=Left/>
<View List=$Resources:core,lists_Folder;/$Resources:core,calendar_Folder; BaseViewID=0 RecurrenceRowset=TRUE WebPartZoneID=Left WebPartOrder=2/>
<AllUsersWebPart WebPartZoneID=Right WebPartOrder=1>
<![CDATA[
<Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ImageWebPart</TypeName>
<FrameType>None</FrameType>
<Title>$Resources:wp_SiteImage;</Title>
<iwp:ImageLink>/_layouts/images/homepage.gif</iwp:ImageLink>
<iwp:AlternativeText>$Resources:core,sitelogo_wss;</iwp:AlternativeText>
</WebPart>
]]>
</AllUsersWebPart>
<View List=$Resources:core,lists_Folder;/$Resources:core,links_Folder; BaseViewID=0 WebPartZoneID=Right WebPartOrder=2/>
<NavBarPage Name=$Resources:core,nav_Home; ID=1002 Position=Start/>
<NavBarPage Name=$Resources:core,nav_Home; ID=0 Position=Start/>
</File>
</Module>
<Module Name=ModuleCool Url=_catalogs/masterpage>
<File Url= MySiteDefinition.master Type=GhostableInLibrary></File>
</Module>
</Modules>
<ServerEmailFooter>$Resources:ServerEmailFooter;</ServerEmailFooter>
</Project>
  1. Add another .xml file (WEBTEMPMySiteDefinition.XML) file to the root of the project by right-clicking the project node and selecting New Item from the Add context menu. Copy the following code in webtemp*.xml file you have just created.
<?xml version=1.0 encoding=utf-8?>
<!– _lcid=”1033″ _version=”12.0.4518″ _dal=”1″ –>
<!– _LocalBinding –>
<Templates xmlns:ows=Microsoft SharePoint>
<Template Name=LyoSalesPortalSD ID=14001>
<Configuration ID=0 Title=My Custom Site Hidden=FALSE ImageUrl=/_layouts/images/stsprev.png Description=Custom Test. DisplayCategory=MyCustomSite > </Configuration>
</Template>
</Templates>
 
Note
The Name attribute must be the same name that you gave the folder containing this Site Definition. Also, the ID attribute must be a unique value greater than 10,000. Values up to and including 10,000 have been reserved for use by WSS v3.
  1. Add an existing default.aspx file to the root of the project by right-clicking the project node and selecting Existing Item from the Add context menu. Navigate to the sts Site Definition folder ([WSS]\TEMPLATE\SiteTemplates\sts). Select default.aspx and click Add.
  2. Copy the following code in default.aspx
<%@ Page language=”C#” MasterPageFile=”~masterurl/default.master” Inherits=”Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c” %> <%@ Register Tagprefix=”SharePoint” Namespace=”Microsoft.SharePoint.WebControls” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %> <%@ Register Tagprefix=”Utilities” Namespace=”Microsoft.SharePoint.Utilities” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %> <%@ Import Namespace=”Microsoft.SharePoint” %> <%@ Register Tagprefix=”WebPartPages” Namespace=”Microsoft.SharePoint.WebPartPages” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<asp:Content ID=”Content1″ ContentPlaceHolderId=”PlaceHolderPageTitle” runat=”server”>
<SharePoint:EncodedLiteral ID=”EncodedLiteral1″ runat=”server” text=”<%$Resources:wss,multipages_homelink_text%> EncodeMethod=”HtmlEncode”/><SharePoint:ProjectProperty ID=”ProjectProperty1″ Property=”Title” runat=”server”/>
</asp:Content>
<asp:Content ID=”Content2″ ContentPlaceHolderId=”PlaceHolderPageImage” runat=”server”><IMG SRC=”/_layouts/images/blank.gif” width=1 height=1 alt=””></asp:Content>
<asp:Content ID=”Content3″ ContentPlaceHolderId=”PlaceHolderPageTitleInTitleArea” runat=”server”>
<label class=”ms-hidden”><SharePoint:ProjectProperty ID=”ProjectProperty2″ Property=”Title” runat=”server”/></label>
</asp:Content>
<asp:Content ID=”Content4″ ContentPlaceHolderId=”PlaceHolderTitleBreadcrumb” runat=”server”/>
<asp:Content ID=”Content5″ ContentPlaceHolderId=”PlaceHolderTitleAreaClass” runat=”server”>
<style type=”text/css”>
TD.ms-titleareaframe, .ms-pagetitleareaframe {
height: 10px;
}
Div.ms-titleareaframe {
height: 100%;
}
.ms-pagetitleareaframe table {
background: none;
height: 10px;
}
</style>
</asp:Content>
<asp:Content ID=”Content6″ ContentPlaceHolderId=”PlaceHolderAdditionalPageHead” runat=”server”>
<META Name=”CollaborationServer” Content=”SharePoint Team Web Site”>
<script type=”text/javascript”>
var navBarHelpOverrideKey = “wssmain”;
</script>
</asp:Content>
<asp:Content ID=”Content7″ ContentPlaceHolderId=”PlaceHolderSearchArea” runat=”server”>
<SharePoint:DelegateControl ID=”DelegateControl1″ runat=”server”
ControlId=”SmallSearchInputBox” />
</asp:Content>
<asp:Content ID=”Content8″ ContentPlaceHolderId=”PlaceHolderLeftActions” runat=”server”>
</asp:Content>
<asp:Content ID=”Content9″ ContentPlaceHolderId=”PlaceHolderPageDescription” runat=”server”/>
<asp:Content ID=”Content10″ ContentPlaceHolderId=”PlaceHolderBodyAreaClass” runat=”server”>
<style type=”text/css”>
.ms-bodyareaframe {
padding: 0px;
}
</style>
</asp:Content>
<asp:Content ID=”Content11″ ContentPlaceHolderId=”PlaceHolderMain” runat=”server”>
<table cellspacing=”0″ border=”0″ width=”100%”>
<tr>
<td class=”ms-pagebreadcrumb”>
<asp:SiteMapPath SiteMapProvider=”SPContentMapProvider” id=”ContentMap” SkipLinkText=”” NodeStyle-CssClass=”ms-sitemapdirectional” runat=”server”/>
</td>
</tr>
<tr>
<td class=”ms-webpartpagedescription”><SharePoint:ProjectProperty ID=”ProjectProperty3″ Property=”Description” runat=”server”/></td>
</tr>
<tr>
<td>
<table width=”100%” cellpadding=0 cellspacing=0 border=”0″ style=”padding: 5px 10px 10px 10px;”>
<tr>
<td valign=”top” width=”30%”>
<WebPartPages:WebPartZone runat=”server” FrameType=”TitleBarOnly” ID=”Left” Title=”Top Left Zone” />
&nbsp;
</td>
<td>&nbsp;</td>
<td valign=”top” width=”40%”>
&nbsp;
</td>
<td>&nbsp;</td>
<td valign=”top” width=”30%”>
<WebPartPages:WebPartZone runat=”server” FrameType=”TitleBarOnly” ID=”Right” Title=”Top Right Zone” />
&nbsp;
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign=”top” width=”30%”>
<WebPartPages:WebPartZone runat=”server” FrameType=”TitleBarOnly” ID=”WebPartZone1″ Title=”Left Center Zone” />
&nbsp;
</td>
<td>&nbsp;</td>
<td valign=”top” width=”40%”>
<WebPartPages:WebPartZone runat=”server” FrameType=”TitleBarOnly” ID=”WebPartZone2″ Title=”Center Zone” />
&nbsp;
</td>
<td>&nbsp;</td>
<td valign=”top” width=”30%”>
<WebPartPages:WebPartZone runat=”server” FrameType=”TitleBarOnly” ID=”WebPartZone3″ Title=”Right Center Zone” />
&nbsp;
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign=”top” colspan=”3″>
<WebPartPages:WebPartZone runat=”server” FrameType=”TitleBarOnly” ID=”WebPartZone4″ Title=”Left Lower Zone” />
&nbsp;
</td>
<td>&nbsp;</td>
<td valign=”top” width=”30%”>
&nbsp;
</td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Content>
 
(I have added more web part zones on the default page. You can always get rid of them.)
  1. Add an existing default.master file to the root of the project by right-clicking the project node and selecting Existing Item from the Add context menu. Navigate to the Global Site Definition folder ([WSS]\TEMPLATE\GLOBAL). Select default.master and click Add.
  2. Rename the file in the preceding step to MySiteDefinition.master.
  3. Copy the following code in default.aspx
<%@Master language=”C#”%>
<%@ Register Tagprefix=”SharePoint” Namespace=”Microsoft.SharePoint.WebControls” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %> <%@ Register Tagprefix=”Utilities” Namespace=”Microsoft.SharePoint.Utilities” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %> <%@ Import Namespace=”Microsoft.SharePoint” %>
<%@ Import Namespace=”Microsoft.SharePoint.ApplicationPages” %>
<%@ Register Tagprefix=”WebPartPages” Namespace=”Microsoft.SharePoint.WebPartPages” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register TagPrefix=”wssuc” TagName=”Welcome” src=”~/_controltemplates/Welcome.ascx” %>
<%@ Register TagPrefix=”wssuc” TagName=”DesignModeConsole” src=”~/_controltemplates/DesignModeConsole.ascx” %>
<HTML id=”HTML1″ dir=”<%$Resources:wss,multipages_direction_dir_value%> runat=”server” xmlns:o=”urn:schemas-microsoft-com:office:office”>
<HEAD id=”HEAD1″ runat=”server”>
<META Name=”GENERATOR” Content=”Microsoft SharePoint”>
<META Name=”progid” Content=”SharePoint.WebPartPage.Document”>
<META HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=utf-8″>
<META HTTP-EQUIV=”Expires” content=”0″>
<SharePoint:RobotsMetaTag ID=”RobotsMetaTag1″ runat=”server”/>
<Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat=”server”/></Title>
<SharePoint:CssLink ID=”CssLink1″ runat=”server”/>
<SharePoint:Theme ID=”Theme1″ runat=”server”/>
<SharePoint:ScriptLink ID=”ScriptLink1″ language=”javascript” name=”core.js” Defer=”true” runat=”server” />
<SharePoint:CustomJSUrl ID=”CustomJSUrl1″ runat=”server” />
<SharePoint:SoapDiscoveryLink ID=”SoapDiscoveryLink1″ runat=”server” />
<asp:ContentPlaceHolder id=”PlaceHolderAdditionalPageHead” runat=”server”/>
<SharePoint:DelegateControl ID=”DelegateControl1″ runat=”server” ControlId=”AdditionalPageHead” AllowMultipleControls=”true”/>
</HEAD>
<BODY scroll=”yes” onload=”javascript:if (typeof(_spBodyOnLoadWrapper) != ‘undefined’) _spBodyOnLoadWrapper();”>
<style type=”text/css”>
#backgroundofpage {
background-color:#ff0000;
font-size:18pt;
}
</style>
<form id=”Form1″ runat=”server” onsubmit=”return _spFormOnSubmitWrapper();”>
<WebPartPages:SPWebPartManager id=”m” runat=”Server” />
<TABLE class=”ms-main” CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=”100%” HEIGHT=”100%”>
<tr><td><asp:ContentPlaceHolder id=”PlaceHolderGlobalNavigation” runat=”server”>
<table CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=”100%”>
<tr>
<td class=”ms-sitetitle”>
<asp:ContentPlaceHolder id=”PlaceHolderSiteName” runat=”server”>
<h1 class=”ms-sitetitle”>
<SharePoint:SPLinkButton runat=”server” NavigateUrl=”~site/” id=”onetidProjectPropertyTitle” >
<SharePoint:ProjectProperty ID=”ProjectProperty1″ Property=”Title” runat=”server” />
</SharePoint:SPLinkButton>
</h1>
</asp:ContentPlaceHolder>
</td>
<td style=”padding-top:8px;” valign=top>
<asp:ContentPlaceHolder id=”PlaceHolderSearchArea” runat=”server” Visible=”false”>
<SharePoint:DelegateControl ID=”DelegateControl5″ runat=”server” ControlId=”SmallSearchInputBox” />
</asp:ContentPlaceHolder>
</td>
<td colspan=4 class=”ms-globalbreadcrumb”>
<span id=”TurnOnAccessibility” style=”display:none”>
<a href=”#” class=”ms-skip” onclick=”SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();return false;”><SharePoint:EncodedLiteral ID=”EncodedLiteral1″ runat=”server” text=”<%$Resources:wss,master_turnonaccessibility%> EncodeMethod=”HtmlEncode”/></a>
</span>
<A id=”A1″ href=”javascript:;” onclick=”javascript:this.href=’#mainContent’;” class=”ms-skip” AccessKey=”<%$Resources:wss,maincontent_accesskey%> runat=”server”><SharePoint:EncodedLiteral ID=”EncodedLiteral2″ runat=”server” text=”<%$Resources:wss,mainContentLink%> EncodeMethod=”HtmlEncode”/></A>
<table cellpadding=”0″ cellspacing=”0″ height=100% class=”ms-globalright” border=”0″>
<tr>
<td valign=”middle” class=”ms-globallinks” style=”padding-left:3px; padding-right:6px;”>
<SharePoint:DelegateControl ID=”DelegateControl2″ runat=”server” ControlId=”GlobalSiteLink0″ />
</td>
<td valign=”middle” class=”ms-globallinks”>
<wssuc:Welcome id=”IdWelcome” runat=”server” EnableViewState=”false”>
</wssuc:Welcome>
</td>
<td style=”padding-left:1px;padding-right:3px;” class=”ms-globallinks”>|</td>
<td valign=”middle” class=”ms-globallinks”>
&nbsp;&nbsp;<a href=’mailto:crmcentral@lyondellbasell.com‘>Feedback & Support</a> &nbsp;|&nbsp;
</td>
<td valign=”middle” class=”ms-globallinks”>&nbsp;
<a href=”javascript:TopHelpButtonClick(‘NavBarHelpHome’)” AccessKey=”<%$Resources:wss,multipages_helplink_accesskey%> id=”TopHelpLink” title=”<%$Resources:wss,multipages_helplinkalt_text%> runat=”server”><img id=”Img1″ align=’absmiddle’ border=0 src=”/_layouts/images/helpicon.gif” alt=”<%$Resources:wss,multipages_helplinkalt_text%> runat=”server”></a>
&nbsp;&nbsp;|&nbsp;&nbsp; <img id=”Img2″ align=’absmiddle’ border=0 src=”/_layouts/images/LB_logo_2col_medium.jpg” alt=”<%$Resources:wss,multipages_helplinkalt_text%> runat=”server”/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:ContentPlaceHolder></td></tr>
<tr>
<td class=”ms-globalTitleArea”>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
</tr>
</table>
</td>
</tr>
<TR>
<TD id=”onetIdTopNavBarContainer” WIDTH=100% class=”ms-bannerContainer”>
<asp:ContentPlaceHolder id=”PlaceHolderTopNavBar” runat=”server”>
<table class=”ms-bannerframe” border=”0″ cellspacing=”0″ cellpadding=”0″ width=”100%”>
<tr>
<td nowrap valign=”middle”></td>
<td class=ms-banner width=99% nowrap ID=”HBN100″>
<asp:ContentPlaceHolder id=”PlaceHolderHorizontalNav” runat=”server”>
<SharePoint:DelegateControl ID=”DelegateControl6″ runat=”server” ControlId=”TopNavigationDataSource”>
<Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode=”False”
SiteMapProvider=”SPNavigationProvider”
id=”topSiteMap”
runat=”server”
StartingNodeUrl=”sid:1002″/>
</Template_Controls>
</SharePoint:DelegateControl>
</asp:ContentPlaceHolder>
</td>
<td class=ms-banner>&nbsp;&nbsp;</td>
<td valign=bottom align=right style=”position:relative;bottom:0;left:0;”>
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td>
<table height=100% class=”ms-siteaction” cellpadding=0 cellspacing=0>
<tr>
<td class=”ms-siteactionsmenu” id=”siteactiontd”>
<SharePoint:SiteActions runat=”server” AccessKey=”<%$Resources:wss,tb_SiteActions_AK%> id=”SiteActionsMenuMain”
PrefixHtml=”&lt;div&gt;&lt;div&gt;”
SuffixHtml=”&lt;/div&gt;&lt;/div&gt;”
MenuNotVisibleHtml=”&amp;nbsp;”
>
<CustomTemplate>
<SharePoint:FeatureMenuTemplate ID=”FeatureMenuTemplate1″ runat=”server”
FeatureScope=”Site”
Location=”Microsoft.SharePoint.StandardMenu”
GroupId=”SiteActions”
UseShortId=”true”
>
<SharePoint:MenuItemTemplate runat=”server” id=”MenuItem_Create”
Text=”<%$Resources:wss,viewlsts_pagetitle_create%>
Description=”<%$Resources:wss,siteactions_createdescription%>
ImageUrl=”/_layouts/images/Actionscreate.gif”
MenuGroupId=”100″
Sequence=”100″
UseShortId=”true”
ClientOnClickNavigateUrl=”~site/_layouts/create.aspx”
PermissionsString=”ManageLists, ManageSubwebs”
PermissionMode=”Any” />
<SharePoint:MenuItemTemplate runat=”server” id=”MenuItem_EditPage”
Text=”<%$Resources:wss,siteactions_editpage%>
Description=”<%$Resources:wss,siteactions_editpagedescription%>
ImageUrl=”/_layouts/images/ActionsEditPage.gif”
MenuGroupId=”100″
Sequence=”200″
ClientOnClickNavigateUrl=”javascript:MSOLayout_ChangeLayoutMode(false);”
/>
<SharePoint:MenuItemTemplate runat=”server” id=”MenuItem_Settings”
Text=”<%$Resources:wss,settings_pagetitle%>
Description=”<%$Resources:wss,siteactions_sitesettingsdescription%>
ImageUrl=”/_layouts/images/ActionsSettings.gif”
MenuGroupId=”100″
Sequence=”300″
UseShortId=”true”
ClientOnClickNavigateUrl=”~site/_layouts/settings.aspx”
PermissionsString=”EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData”
PermissionMode=”Any” />
</SharePoint:FeatureMenuTemplate>
</CustomTemplate>
</SharePoint:SiteActions>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:ContentPlaceHolder>
</TD>
</TR>
<asp:ContentPlaceHolder ID=”WSSDesignConsole” runat=”server”>
<wssuc:DesignModeConsole id=”IdDesignModeConsole” runat=”server” />
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID=”SPNavigation” runat=”server”>
<SharePoint:DelegateControl ID=”DelegateControl7″ runat=”server” ControlId=”PublishingConsole”
PrefixHtml=”&lt;tr&gt;&lt;td colspan=&quot;4&quot; id=&quot;mpdmconsole&quot; class=&quot;ms-consolemptablerow&quot;&gt;”
SuffixHtml=”&lt;/td&gt;&lt;/tr&gt;”
>
</SharePoint:DelegateControl>
</asp:ContentPlaceHolder>
<TR height=”100%”><TD><TABLE width=”100%” height=”100%” cellspacing=”0″ cellpadding=”0″>
<tr>
<td class=”ms-titlearealeft” id=”TitleAreaImageCell” valign=”middle” nowrap><div style=”height:100%” class=”ms-titleareaframe”><asp:ContentPlaceHolder id=”PlaceHolderPageImage” runat=”server”/></div></td>
<td class=”ms-titleareaframe” id=”TitleAreaFrameClass”>
<asp:ContentPlaceHolder id=”PlaceHolderTitleLeftBorder” runat=”server”>
<div class=”ms-titleareaframe”><IMG SRC=”/_layouts/images/blank.gif” width=1 height=100% alt=””></div>
</asp:ContentPlaceHolder>
</td>
<td valign=top id=”onetidPageTitleAreaFrame” class=’ms-pagetitleareaframe’ nowrap>
<table id=”onetidPageTitleAreaTable” cellpadding=0 cellspacing=0 width=100% border=”0″>
<tr>
<td valign=”top” class=”ms-titlearea”>
<asp:ContentPlaceHolder id=”PlaceHolderTitleBreadcrumb” runat=”server”>
<asp:SiteMapPath SiteMapProvider=”SPContentMapProvider” id=”ContentMap” SkipLinkText=”” NodeStyle-CssClass=”ms-sitemapdirectional” runat=”server”/> &nbsp;
</asp:ContentPlaceHolder>
</td>
</tr>
<tr>
<td height=100% valign=top ID=onetidPageTitle class=”ms-pagetitle”>
<h2 class=”ms-pagetitle”>
<asp:ContentPlaceHolder id=”PlaceHolderPageTitleInTitleArea” runat=”server” />
</h2>
</td>
</tr>
</table>
</td>
<td class=”ms-titlearearight”>
<asp:ContentPlaceHolder id=”PlaceHolderMiniConsole” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderTitleRightMargin” runat=”server”>
<div class=”ms-titleareaframe” style=’height:100%’><IMG SRC=”/_layouts/images/blank.gif” width=1 height=1 alt=””></div>
</asp:ContentPlaceHolder></td>
</tr>
<asp:ContentPlaceHolder id=”PlaceHolderTitleAreaSeparator” runat=”server”/>
<TR>
<TD class=”ms-leftareacell” valign=top height=100% id=”LeftNavigationAreaCell”>
<table class=ms-nav width=100% height=100% cellpadding=0 cellspacing=0 border=”0″>
<tr>
<td>
<TABLE height=”100%” class=ms-navframe CELLPADDING=0 CELLSPACING=0 border=”0″>
<tr valign=”top”>
<td width=”4px”><IMG SRC=”/_layouts/images/blank.gif” width=4 height=1 alt=””></td>
<td valign=”top” width=”100%”>
<asp:ContentPlaceHolder id=”PlaceHolderLeftNavBarDataSource” runat=”server” />
<asp:ContentPlaceHolder id=”PlaceHolderCalendarNavigator” runat=”server” />
<asp:ContentPlaceHolder id=”PlaceHolderLeftNavBarTop” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderLeftActions” runat=”server”></asp:ContentPlaceHolder>
</td>
</tr>
</TABLE>
</td>
<td><asp:ContentPlaceHolder id=”PlaceHolderLeftNavBarBorder” runat=”server”></asp:ContentPlaceHolder></td>
</tr>
</table>
</TD>
<td><asp:ContentPlaceHolder id=”PlaceHolderBodyLeftBorder” runat=”server”>
<div class=”ms-pagemargin”><IMG SRC=”/_layouts/images/blank.gif” width=10 height=1 alt=””></div>
</asp:ContentPlaceHolder></td>
<td class=’ms-bodyareacell’ valign=”top”>
<PlaceHolder id=”MSO_ContentDiv” runat=”server”>
<table id=”MSO_ContentTable” width=100% height=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″ class=”ms-propertysheet”>
<tr>
<td class=’ms-bodyareaframe’ valign=”top” height=”100%”>
<A name=”mainContent”></A>
<asp:ContentPlaceHolder id=”PlaceHolderPageDescription” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderMain” runat=”server”>
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</PlaceHolder>
</td>
<td class=”ms-rightareacell”><asp:ContentPlaceHolder id=”PlaceHolderBodyRightMargin” runat=”server”>
<div class=”ms-pagemargin”><IMG SRC=”/_layouts/images/blank.gif” width=10 height=1 alt=””></div>
</asp:ContentPlaceHolder></td>
</TR>
<tr>
<td class=”ms-pagebottommarginleft”><IMG SRC=”/_layouts/images/blank.gif” width=1 height=10 alt=””></td>
<td class=”ms-pagebottommargin”><IMG SRC=”/_layouts/images/blank.gif” width=1 height=10 alt=””></td>
<td class=”ms-bodyareapagemargin”><IMG SRC=”/_layouts/images/blank.gif” width=1 height=10 alt=””></td>
<td class=”ms-pagebottommarginright”><IMG SRC=”/_layouts/images/blank.gif” width=1 height=10 alt=””></td>
</tr>
</TABLE></TD></TR>
</TABLE>
<asp:ContentPlaceHolder id=”PlaceHolderFormDigest” runat=”server”>
<SharePoint:FormDigest ID=”FormDigest1″ runat=server/>
</asp:ContentPlaceHolder>
<input type=”text” name=”__spDummyText1″ style=”display:none;” size=1/>
<input type=”text” name=”__spDummyText2″ style=”display:none;” size=1/>
</form>
<asp:ContentPlaceHolder id=”PlaceHolderUtilityContent” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderBodyAreaClass” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderTitleAreaClass” runat=”server”/>
</BODY>
</HTML>
 
This is a customized master page. No Quick Launch, no Top menu bar, no search box. (You can replace this code with original one of GLOBAL/default.master if you want to see the site identical to Team Site)
  1. Right-click on the project node and select Properties from the context menu.
  2. Click on the Build Events tab.
  3. Enter the following command in the “Post-build event command line” text box to copy the WebTemp.xml file to the correct location. Be sure that the entire command is on a single line.
xcopy ..\..\WEBTEMPMySiteDefinition.XML “C:\Program Files\Common. Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML\” /y
  1. Save your changes, and build the project by right-clicking on the project node and selecting Build.
  2. Reset Internet Information Services (IIS) or recycle the application pool of the web application in which you will be testing your Site Definition.
  3. Open a browser to any WSS v3 site within the preceding web application. Choose Create from the Site Actions menu and choose Sites and Workspaces. Your custom Site Definition will appear under the MyCustomSite tab in the Template Selection section of the New SharePoint Site page.
Hurrrey…. There you go……
Advertisements

Posted in SharePoint Blogs | Tagged: , , | Leave a Comment »