Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
6 Months Free & No Setup Fees ASP.NET Hosting!
Search :       Advanced Search »
Home » SharePoint » Site Definition in SharePoint

Site Definition in SharePoint

This article will explain about Site Definition, why we do need custom site definition ?and how to create and deploy a custom site definition.

Author Rank :
Page Views : 26095
Downloads : 0
Rating :
 Rate it
Level : Intermediate
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
Team Foundation Server Hosting
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 


Site Definition

  • Site Definitions are the foundations on which all sites and user templates are built. 
  • Site Definition is collection ox XML and .aspx file.
  • Site Definitions are predefined components needs to be included when a site was created in SharePoint server.
  • Site Definition contains information of Web Part , Lists, Features and navigation bars to be included in the site.
  • Customizing Portal Sites and other SharePoint sites using Site Definition is most appropriate for third party developer and SharePoint Administrator.
  • Site Definitions requires access to a file system of the Web Server.
  • Server administrator must be also involved in deployment of Site Definitions. 
  • Custom Site Definitions are Version and Upgrade independent. 
  • Subsequent upgrades to SharePoint products  and technologies may overwrite  existing Site Definitions. Using Custom Site definition exclude site from potential upgrade issues. 
  • To avoid Unghosting  , Custom Site Definition is to be create.
  • There are two options to create it
    1. Create New Site Definition File : Either Start from Scratch and create files one by one  or Copy an existing Site Definition and modify it.

    2. Copy a Site Definition and change it in Visual Studio:   We can make copy an existing site definition and modify it in visual studio to create new site definition.

  • The configuration of this site definitions are defined in XML file which is available in

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML folder.

  • In the file system these definitions are available in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Site Templates.

  • Each of these site definitions consists a XML folder and a Home page (default.aspx).

Steps to create custom Site Definition

1. Log on as an administrator

2. Browse to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates.

Copy STS folder-> Paste it at same place -> Rename it as TIGER.

3. Open the folder Tiger

4. Search for default.aspx

5. Open default.aspx in notepad.

6. Modify code. Here we need to add code for site definition.

Default.aspx

<%@ Page language="C#" MasterPageFile="~masterurl/default.master"    

Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,P

ublicKeyToken=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 runat="server" text="<%$Resources:wss,multipages_homelink_text%>" 

EncodeMethod="HtmlEncode"/> - <SharePoint:ProjectProperty 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 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 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 Property="Description" 

runat="server"/></td>

            </tr>

            <tr>

                   <td>

                    <table width="100%" cellpadding=0 cellspacing=0 style="padding: 5px 10px 10px 10px;">

<tr>

<td valign="top" width="100%" colspan="3">

<WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Top" Title="loc:Top" />

</td>

</tr>

                     <tr>

                      <td valign="top" width="70%">

                                <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Left" 

Title="loc:Left" />

                                &nbsp;

                      </td>

                      <td>&nbsp;</td>

                      <td valign="top" width="30%">

                                <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Right" 

Title="loc:Right" />

                                &nbsp;

                      </td>

                      <td>&nbsp;</td>

                     </tr>

                    </table>

                   </td>

            </tr>

              <tr>

              <td valign=”top” width=”100%” colspan=”3”>

                 <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Bottom" 

Title="loc:Bottom" />  

              </td>

              </tr>

          </table>

</asp:Content>

7. Register new site definition to SharePoint.

8. Open the folder

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML

9. Copy the file WEBTEMP.XML and save it as WEBTEMPTIGER.xml. here make a note that , we need to append name of folder which we created in step 2 ( in this case it is tiger) to WEBTEMP. So here name would be WEBTEMPTIGER.xml

10. Open WEBTEMPTIGER.XML in notepad and replace it with following content.

<?xml version="1.0" encoding="utf-8"?>

<!-- _lcid="1033" _version="12.0.4518" _dal="1" -->

<!-- _LocalBinding -->

<Templates xmlns:ows="Microsoft SharePoint">

 

  <Template Name="TIGER" ID="10009">

 

    <Configuration ID="1" Title="Tiger Definition" Hidden="FALSE" ImageUrl="/_layouts/images/Eye.GIF" Description="Tiger Site." DisplayCategory="Custom" AllowGlobalFeatureAssociations="False" >    </Configuration>

 

  </Template>

</Templates>

Make sure here ID should be greater than 10000. It must not collide with id of any other Site Definition.

11. Restart IIS. Go to Start->Run->IISRESET

12. Now you would be able to see this Site Definition inside Custom category.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Dhananjay Kumar
I write few articles on Microsoft technologies. Read my blog at . | Mincracker MVP | Microsoft MVP
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Discover the Top 5 .NET Memory Management Fundamentals
To write the best .NET code, you need to know exactly how the .NET framework really manages memory. Ricky Leeks presents the Top 5 fundamental facts of .NET memory management. Learn more.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Team Foundation Server Hosting
Become a Sponsor
 Comments
Regarding Customized Site defination by Gourav On May 14, 2009
Hi,
I have created a site defiantion with the mentioned process...
but any how after creating the site defination i have got this error
An error occurred during the processing of . Could not load the assembly 'Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,P

ublicKeyToken=71e9bce111e9429c'. Make sure that it is compiled before accessing the page.


plesae put some light on the matter...
Reply | Email | Modify 
Hi Dhananjay by Abhay On February 16, 2011
Abhay here, very nice post thankyou so much.
Reply | Email | Modify 

 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.