Friday 10 June 2011

Create custom SharePoint theme .thmx using PowerPoint

Within SharePoint 2010 there is the ability to set themes against sites.  This provides a quick way of changing the colours of certain areas of the site like the quick lunch,  navigation bar and hyperlinks.

It turns out that SharePoint can use the same file format for its theme as PowerPoint uses to brand slides.  Therefore we can use PowerPoint to create the .thmx file and use the resulting file within SharePoint.

Step 1

Open up PowerPoint.  Select the Design Tab then Colors.

PowerPoint - Theme

Step 2

Within Colors click “Create New Theme Colors”

PowerPoint - Colors

Step 3

You can now start creating you own custom theme.  Notice that the Theme options are the same as provided within SharePoint.

PowerPoint Create Theme

Give your newly created theme and name and click save.

Step 4

You now need to save the theme as a .thmx file which you can use within SharePoint.

Save Theme

Step 5

Now that you have a .thmx file containing your theme you can import in into your SharePoint site.

Within Site Settings you should see a Theme link within the Galleries grouping.

SharePoint Theme

Within here you can upload your .thmx file to SharePoint.

Step 6

Now that the theme is within SharePoint you can make use of it through the UI or you can reference it from code.

using (SPSite curSite = new SPSite("http://sharepoint"))
{
    using (SPSite curWeb = curSite.OpenWeb())
    {
        ReadOnlyCollection<ThmxTheme> siteThemes
            = ThmxTheme.GetManagedThemes(curSite);
        foreach (ThmxTheme theme in siteThemes)
        {
            if (theme.Name == "SharePointCustomTheme")
            {
                theme.ApplyTo(curWeb, true);
                break;
            }
        }
    }
}

1 comment:

  1. Is this possible for SharePoint 2013? I have just signed up for a free SharePoint 2013 site with http://www.cloudappsportal.com.

    ReplyDelete