in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

tigirry's SharePoint Blog

Easy way of Editing Customized Theme in MOSS 2007

Recently, I have observed that many MOSS 2007 and/or WSS 3.0 administrators want to apply their custom theme to site collections. In my opinion, this is a good practice because you never want to edit the "core.css" file - it is just stupid :) For those who still want to modify the "core.css" file in spite of my advice, the file is in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\STYLES folder".

When using SharePoint Portal Server 2003, you could easily test and apply your customized .css file by inserting a html tag after

<Link REL="stylesheet" Type="text/css" HREF="/_layouts/1033/styles/ows.css">

in <HEAD> section of .aspx files. "Ows.css" file in SharePoint Portal Server 2003 was the "core" stylesheet file and by inserting a new stylesheet link tag after this line, any style attribute in "ows.css" file gets overwritten by your customized .css file.

HOWEVER, you cannot do this in MOSS 2007 and WSS 3.0. By default, there exists no stylesheet link tag for "core.css" in the <HEAD> section of any .aspx file. "Core.css" will be applied automatically at the end of any tag in the <HEAD> section.

Here I will explain how to edit and apply your custom theme in SharePoint Designer 2007 and this is the easiest way to modify your custom theme.css file.

1. First create a custom theme; you can refer my other post: http://www.sharepointblogs.com/tigirry/archive/2007/07/03/custom-site-theme-for-sharepoint-2007-moss-2007-and-wss-3-0.aspx

2. Go to "Site Actions" -> "Site Settings" -> "Site Theme" in your SharePoint site collection and choose your custom theme and apply. Let us assume that the site collection's url is http://mycustomsite.

3. Now launch SharePoint Designer 2007 and go to "File" -> "Open Site..." and type http://mycustomsite in "Site name" field. Click "Open" to open the site.

4. In the left side, you should see "Folder List". If you don't see this, press ALT & F1 or go to "View" and select "Folder List".

5. In the "Folder List", browse to "_themes" folder. You should have a subfolder which is your custom theme folder. Let us assume that the name of the custom theme applied is "CustomBrown" and the subfolder name is "CustomBrown" as well. Editing this subfolder will not change your original theme folder at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\CustomBrown". What you see in the "Folder List" is the copy version of your custom theme folder.

6. In "CustomBrown" folder, look for the "Cust1011-65001.css" file. This file is created by the site collection when you apply any new theme and it is copied over to overwrite the site collection's "core.css" file. This file does not physically change "core.css" file but this file will be read after the "core.css" file. The format of this file is always "****1011-65001.css" and first 4 characters are always the first four characters of your custom theme name.

7. Make changes to this "****1011-65001.css" file as needed and you can also add/edit .jpg and .gif files as you make changes to the "****1011-65001.css" file.

8. When you want to apply and review the custom theme, simple save the .css file and you will see the changes you have made. If you don't see any change, click F5 to refresh or go to "View" and select "Refresh".

9. After you have finished modifying the .css file, copy its content and replace the content of "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\CustomBrown\theme.css" file with it. You also want to copy and paste any image file you have added or edited to this local folder.

10. Apply a different site theme to your site and apply the "CustomBrown" theme back to the site. You should see all your changes.

Hope you enjoy customizing!!

Comments

 

Links (7/29/2007) « Steve Pietrek’s SharePoint Stuff said:

Pingback from  Links (7/29/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

July 29, 2007 7:40 PM
 

Servé Hermans said:

Good description. One thing I've discovered over the past few days. Sometimes it happens that your most recent changes are not showing up when you apply your theme from the Site Settings. That has to do with the objects cached in the application pool. Recycle the application pool from IIS manager and then reapplye your theme. It will solve the problem.

August 14, 2007 4:48 AM
 

EdKrull said:

Is it possible to apply a custom theme to a custom Site Definition. Everything I have tried to make my sites show up with theme other than "default" has failed. I can create a Template using an old site and that will use the custom theme by default, but whenever I use a Custom Site Definition (as outlined by you) it uses the default theme.

August 16, 2007 12:28 PM
 

tanveer said:

But i have to chage the css dynamically, when the user logs in.can it be done?i cant ask the customer to change the css,i have to do it with codes.I am in deep trouble.Can any one suggest any solution?

August 17, 2007 5:06 AM
 

John Johnson said:

Great Post! Very helpful after reading the other about creating a custom theme!

August 17, 2007 1:23 PM
 

EdKrull said:

Well, I ended up editing the CORE.CSS, which surely I am not supposed to do. However, it was pretty easy in that the last 1/3 or so of the CORE.CSS contains all of the same tags that you in your custom theme. Change the locations of the images in your custom theme  CSS section to this directory:

/_layouts/images/

Copy the images themselves to this directory:

Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES

Viola, your custom theme is now the default theme.

August 23, 2007 9:58 AM
 

MOSS is my middle name said:

Very helpful! Thanks a lot!

January 1, 2008 3:46 AM
 

Martin Rousev said:

What will happen if I copy the edited theme from my development server to the production site? Will the changes be there? Why can't I just edit the theme.css file in the theme folder?

January 23, 2008 2:30 PM
 

Tim Farrell said:

I have made extensive changes to my custom css file but I can get rid of the images in the maintitle area or along the left and right sides of the page.  Oddly enough the original images were remove but then the default theme images replaced them.

There certainly is a hook somewhere...

February 26, 2008 2:23 PM
 

toni said:

Good description and Thanks for the step-by-step instructions .i have selected the collaboration template and i am able to see all the changes on the first page .But not on other pages and my client is pleased to see the page after making the changes THANKS AGAIN to you

now the issue is

1) how to apply the same theme to all the other pages on the site collection

2) my client wants me to change the color of the text which is being displayed on the side navigation and on the glodal navigation tabs to black color

Please guide me

Regards,

toni

March 31, 2008 11:51 AM
 

Jade said:

I too had to restart the application pool to get my changes to theme.css show up.  even iisreset didn't do it.

April 2, 2008 4:03 PM
 

toni said:

i was able to make all the changes but when after making the changes to

1) Cust1011-65001.css and replace the content of "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\CustomBrown\theme.css"

2)  in the ms-pagetitle  the changes are not seen and when i opened the Cust1011-65001.css file the number of lines of code got increased by itself and copy of ms-pagetitle was seen  with the default  url of the image

Please help

April 4, 2008 11:29 AM
 

Midway76 said:

Please note that the "****1011-65001.css" file is in fact a merge of the theme.css file and the mossextension.css file.  So when using the procedure used in this post, styles defined in the mossextension.css could override styles in your theme.css.

To solve this issue, I've opened mossextension.css on my server, I've deleted the entire content and saved the file.  Sharepoint now appends an empty file after the actual theme file that I created.

May 1, 2008 2:41 PM
 

June said:

Can more than one custom theme appear in the folder list in Designer? I'm only seeing one of the themes I've created, so I'm not able to edit my second custom theme as described above. Advice?

June 18, 2008 10:51 AM
 

Altug said:

Hello,

I have received  MENU.css and OWS.css file from coporate.There is also a file called OWS.js. What are these...

July 17, 2008 3:43 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

About tigirry

Title; SharePoint Developer / ASP.NET Developer Certifications: MCPD: Web Developer MCTS: Microsoft Office SharePoint Server 2007 – Application Development MCTS: Microsoft Windows SharePoint Services 3.0 – Application Development MCTS: Microsoft Office SharePoint Server 2007 – Configuring MCTS: Microsoft Windows SharePoint Services 3.0 – Configuring

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts