Wednesday, May 02, 2012

SharePoint FARM level / Global changes on Master Page

Hi,
Before reading this post, I would like to request all reader, this is NOT recommended solution. Don't go for this kind of practice until there is no other option. 


Product : SharePoint 2010


Scenario : 
Sometimes you may be come around with a requirement putting a link or text through all sites in your SharePoint farm. 
In that case if you do some changes at Farm Level Master Template, so that it can be inherited to all master pages. 

  1. Log in to your Server
  2. Browse to folder "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL"
  3. Copy v4.master page file and keep it as back up in a safe location.
  4. Open the v4.master page file in VS.NET or even notepad.
  5. In the editor, find the opening <body> tag and add the following to the next line.
  6. <h1> Hello World </h1>
  7. Save the file.
Now you open any page or site on your SharePoint Farm. "Hello World" will be placed.
You may replace "hello world" with any html code. 


Further in case you want to exclude this information being visible for a particular site, you can open the site's master page and remove the line which you added in top master page. 


In next blog I will write how to insert a piece of Javascript & C# code in your site master page so that it can be visible to any page through out the site.