Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

Site Definitions & SharePoint Designer

/
/
ad-mania

Have you ever noticed that when you modify a page in SharePoint Designer (2007 or 2010) it adds a blue icon next to the document with the letter i in the middle? The icon next to the page means that the page has been customized. In this article, I will discuss the important concept of page customization and site definition in SharePoint and talk about the best practice for dealing with master pages for your SharePoint sites.

What are Site Definitions?

In SharePoint Designer we can customize the pages. For example, we can modify the default home page and put our logo and custom Web parts. However, sometimes if we really mess the page and don’t like the way it looks, we can reset to the site definition. A Site Definition is a bunch of files on the Web server that define a unique type of SharePoint site. When you create a new site it is based on a site definition. Let’s say you customize a page but then don’t like the way it looks. You can reset the page to the site definition, which will discard all the changes you made to the page put it back to the way it was originally defined in the site definition.

Reset to Site Definition

While working in SharePoint Designer, you may have noticed that sometimes when you reset a page to the site definition you lose all your changes, while other times you don’t lose anything at all. Here’s the explanation as to why this happens. You won’t lose any changes to the Web parts that reside in a Web part zone that exists on the site definition page. You will, however, lose all changes that you made to the Web parts that reside outside the site definition page. For example, let’s say you add a Content Editor Web Part (CEWP) to Zone 1 that was part of the site definition on your homepage. You add your logo and some text to the CEWP Web part. Then you create Zone 2 and add another Web part with some content. When you reset the page to site definition, you will not lose anything in Zone 1. Your text and logo will be intact. However, you will lose everything that you added to Zone 2, including the Web part and its content. That’s because Zone 2 was not part of the site definition but Zone 1 was.

NOTE: If you create a page from either a blank page or create it in another program and then import it into SharePoint Designer, that page cannot be reset to the site definition.

Resetting to Site Definition Isn’t Always Necessary

Here’s a tip. You don’t always have to reset the page to site definition to restore it to its original condition. Instead, you can use versioning. If you are working with pages that reside in a document library, you can use versioning to simply go back to the previous version. Because the Master Page Gallery is a document library and all the master pages reside in that library you can simply turn on versioning and instead of resetting the master page to the site definition, you can revert to the previous version.

As mentioned earlier, if a page is customized you will see a blue icon with letter i in the middle. This simply means that the page was customized.

As a best practice, I recommend that you don’t modify the original master page. Instead, create a copy of the master page, rename it, e.g. MyMaster, and make it the default page. You can even create a CSS style sheet and associate it to the custom master page that you have created. This might be a good topic to discuss at another time. If you are interested in that topic, you might want to subscribe to my blog’s RSS feed to get notified automatically.


Copyright ©2011 Zubair Alexander. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar