Creating Custom Templates in SharePoint


Introduction:

When you install Share point then you will be getting 11 predefined templates like

  1. Windows SharePoint Services Site
  2. SharePoint Portal Server Site
  3. SharePoint Portal Server Personal Space
  4. SharePoint Portal Server My Site
  5. Contents area Template
  6. Topic area template
  7. News area template
  8. News Home area template
  9. Site Directory area template
  10. SharePoint Portal Server BucketWeb Template
  11. Community area template

These templates can be located at C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033.

Advantages of having custom templates.

  1. You can control  the Look and feel of the web site page.
  2. You can have your predefined custom web parts.
  3. Not required to drag and drop web parts.
  4. Same look and feel across the web site page.

Steps for Creating Custom Templates in Share Point.

  1. Copy SPS folder from C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033 and Rename it as SPSCustom folder.

  2. Open default.aspx from C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\SPSCustom. Create you own structure here like

    <table border=0 cellpadding=0 cellspacing=0>
          
    <tr>
               
    <td width=170 valign=top>
                     
    <WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="TopZone"
                        
    Title="TopZone" Orientation="Vertical"></WebPartPages:WebPartZone>
                
    </td>
          
    </tr>
    </table>

  3. Open onet.xml from C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\SPSCustom\XML. Add the following section under
    <Components>
      <Modules>
        <Module>
          <File>

    <AllUsersWebPart WebPartZoneID="TopZone" WebPartOrder="0">
            <![
    CDATA[<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
                 <
    Assembly>AssemblyName, Version=1.0.0.0,Culture=Neutral, 
                  PublicKeyToken=1111111111111111
    </Assembly>
                  <
    TypeName> NameSpaceName.AssemblyName</TypeName>
                  <
    Title>Web Part Title</Title>
                  <
    Description>My Own Custom Web Part</Description>
                  <
    PartOrder>0</PartOrder>
                  <
    FrameType>None</FrameType>
                  <
    AllowMinimize>true</AllowMinimize>
                  <
    AllowRemove>true</AllowRemove>
                  <
    IsVisible>true</IsVisible>
                  <
    AllowOverrideGlobalXML xmlns="NameSpaceName">false</AllowOverrideGlobalXML>
             </
    WebPart>]]>
    </AllUsersWebPart>

    Replace NameSpaceName with your NameSpace name
    Replace AssemblyName with your Assembly Name

  4. Open WEBTEMPSPS.XML from C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\XML. Add the below section under

    <Templates>
           <Template Name="SPSCustom" ID="1036">
           <Configuration ID="0" Title="My Custom Template" Type="0" Hidden="TRUE"
           ImageUrl
    ="../images/spshome.gif" Description="Area Template</Configuration>
    </Template>

    Name = should be your custom folder name
    ID = should be any four digit number which should be unique
    Title= can be your own title which will be displayed in your web site list box.

  5. Do iisreset.

  6. Navigation steps to see the below screen

    • You need to be Administrator on the Portal Server
    • Open Home page of your portal
    • Click on Change Settings Sub Area link available in the left side of the screen.
    • Click on Page tab.