Wednesday, September 07, 2011

Create a custom site theme for SharePoint and make it available to others


Here are the steps you can follow to create your own custom theme and make it available to others in your organization. For this example, I created a new theme called "My Custom Theme" based on the Classic theme in SharePoint.

1 - Identify a theme that closely resembles the theme you want to create

The first step is to first take a look at the existing themes available in SharePoint and determine if one of those themes closely resembles the theme that you want to create.
  1. Go to the SharePoint site where you want to create the theme (log on, if necessary).
  2. Click the Site Actions menu and choose Site Settings.
  3. Under Look and Feel, click Site theme.
  4. Look through the themes until you find one that closely resembles the theme you want to create. Note the name of the theme so you can find the files you need for later steps.
  5. For this example, I know that I want to use the Classic theme.
  6. Cancel out of the Site Theme page.
2- Create your custom theme folder
  1. Log onto the server that hosts your SharePoint site and browse to the following folder:
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES
  2. Copy the folder that corresponds with our theme. In my case, I copied the Classic folder.
  3. Paste this into this same THEMES folder, so that you end up with a Copy of THEMENAME folder. In my case, I ended up with a Copy of CLASSIC folder.
  4. Rename this folder to MyCustomTheme.
3 - Modify the theme setup information file (INF)
  1. Open the MyCustomTheme folder and locate the name of the theme you chose as a starting point for your new theme. For example, CLASSIC.INF.
  2. Rename CLASSIC.INF (or the INF file for the theme you chose) to MYCUSTOMTHEME.INF (yes, please use upper case).
  3. Edit MYCUSTOMTHEME.INF in Notepad (or your preferred text editor).
  4. Perform a search and replace in this file, replacing every instance of Classic (or the theme you chose) withMyCustomTheme.
  5. Save and close MYCUSTOMTHEME.INF.
4 - Modify the SPTHEMES.XML file
  1. Browse to the following folder:
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033
  2. Locate SPTHEMES.XML.
  3. Edit SPTHEMES.XML in Notepad (or your preferred text editor).
  4. Add the following text after the <SPThemes> tag so that it matches the other templates in this file:
    <Templates>
     <TemplateID>MyCustomTheme</TemplateID>
     <DisplayName>My Custom Theme</DisplayName>
     <Description>My Custom Theme.</Description>
     <Thumbnail>images/mycustomtheme.gif</Thumbnail>
     <Preview>images/mycustomtheme.gif</Preview>
    </Templates>
  5. Save and close SPTHEMES.XML.
  6. Reset the server so that your theme shows up on the Site Theme page in SharePoint. You can reset the server by entering the following text in the Start > RUN line:
    iisreset computer name
    (where computer name is the name of the server)
5 - Apply your custom theme to your site
  1. Return to your SharePoint site.
  2. Click the Site Actions menu and choose Site Settings.
  3. Under Look and Feel, click Site theme.
  4. In the list of themes, select My Custom Theme.
  5. Click Apply.
    Your site will look no different from the Classic theme since we based your custom theme on it. 

No comments:

Post a Comment

Enable UAT database over OneBox DevTest environment using JIT

 Dear Friends, In this Article I will show you how to enable UAT database access for Development machine using just-in-time (JIT). Many time...