Home > DeveloperSection > Beginner > Create and Apply a Theme in SharePoint

Create and Apply a Theme in SharePoint


SharePoint SharePoint 
Ratings:
3 Comment(s)
 3475  View(s)
Rate this:

Create and Apply a Theme in SharePoint

In this article I am going to explain and show you how to create and customize the theme with the help of PowerPoint and apply it in the SharePoint Site. I also demonstrate how to apply the theme programmatically in SharePoint.

Follow these steps to create a Theme:

  • Open Microsoft PowerPoint 2010.
  • Go to Design Tab.
  • Click the drop down arrow in colors.
  • Click on "Create New Theme Colors".

Create and Apply a Theme in SharePoint

·         Choose the Theme colors as per your requirement.

 

·         Enter the Name and click on Save.

Create and Apply a Theme in SharePoint

·         Go to File à Save As type.

 

·         Enter File Name as MyTheme.

 

·         Choose Office Theme in Save As Type.

  • Click on Save.

Create and Apply a Theme in SharePoint

  • Open the SharePoint Site.
  • Go to Site Actions à Site Settings à Galleries à Themes.

Create and Apply a Theme in SharePoint

Create and Apply a Theme in SharePoint

·         Click Add new item and browse your theme and add the theme file that we have created.

Create and Apply a Theme in SharePoint

After adding a theme you have to apply it in the SharePoint Server:

·         Go to Site Actions à Site Settings à Look and Feel à Site Theme.

Create and Apply a Theme in SharePoint

·         Select the theme which we have created and Click on Apply to apply the theme in the SharePoint Server.

Create and Apply a Theme in SharePoint

The sites look like the following:

Create and Apply a Theme in SharePoint

Now you have to apply the theme programmatically in the SharePoint Site:

1)    Open Visual Studio and create a Console Application.

 

Create and Apply a Theme in SharePoint

Write the below code in the Program.cs file:

using System;

using System.Text;

using Microsoft.SharePoint;

using Microsoft.SharePoint.Utilities;

using System.Collections.ObjectModel;

 

namespace ApplyThemeinSharePoint

{

    class Program

    {

        static void Main(string[] args)

        {

            using (SPSite objSite = new SPSite("http://rohit:34143/"))

            {

                using (SPWeb objWeb = objSite.OpenWeb())

                {

                    ReadOnlyCollection<ThmxTheme> objThemeList;

                    objThemeList = ThmxTheme.GetManagedThemes(objSite);

                    foreach(ThmxTheme objThmx in objThemeList)

                    {

                        if (objThmx.Name == "Berry")

                        {

                            ThmxTheme.SetThemeUrlForWeb(objWeb,
                                                        objThmx.ServerRelativeUrl);

                            break;

                        }

                    }

                }

            }

            Console.WriteLine("Berry Theme applied in the SharePoint Site");

        }

    }

}

 

Output:

Create and Apply a Theme in SharePoint

Now you can see in your SharePoint site Berry Theme is applied. Now the site looks like the following:

Create and Apply a Theme in SharePoint

Thanks for reading this article. After reading this article you can easily create the theme with help of PowerPoint and can also apply the theme in the SharePoint site.


Appling Theme in sharepoint.

By James Smith on   4 years ago
Thanks Rohit,
Its really useful.

Apply theme.

By Jenry Hock on   4 years ago
Thanks Rohit.

Apply Theme in Sharepoint

By Arun Singh on   4 years ago

Hi Rohit,

Very informative article. Its really helped me lot.

 

Thanks


Don't want to miss updates? Please click the below button!

Follow MindStick