One common request from customers when it comes to SharePoint Customization is, How do I add my company logo to the site? This was common in V2, and it’s just as common with 2007.
You might be quick to point out that in 2007 “Hey that’s easy, you can do it from the browser by selecting Site Title, Description and Icon from the Site Settings page right?.
While you would be correct in saying this, what happens when the customer creates sub sites and while navigating through these sites realizes hey wait a minute, where’s my logo – you fraud!
While the OOTB functionality is great for specifying the logo on a site by site basis there is no way to have this inherited by all sub sites which are created there after. If you create 20, 30, 40 subsites, you would be forced to change the logo in the site settings of every site.
This easily forseeable crisis which you will inevitably face at some point is actually easy to deal with thanks to the power of .MASTER pages.
Getting started adding a company logo to the master page:
- Browse to the top level of your site collection in the browser.
- From The Site Actions Menu, Select View All Site Content
- Select the Site Collection Images Library
- Upload your Company Logo (companylogo.gif) – If required, approve this image.
- Open SharePoint Designer 2007 and Select File, Open Site. Type the URL of the top level of your site collection.
- Locate the master page gallery in the left pane. _catalogs\masterpage
- Double click the default.master (you may be prompted to check it out – if so choose yes)
- Search For: <SharePoint:SiteLogoImage id=”onetidHeadbnnr0″ LogoImageUrl=”/_layouts/images/titlegraphic.gif” runat=”server”/>
- Repace With: <asp:Image runat=”server” id=”logo” ImageUrl=”< %$ SPUrl: ~sitecollection/sitecollectionimages/companylogo.gif %>/>
What the above does is replace the default (site by site) mechanism for replacing the company logo with a hard coded reference to the company logo which you uploaded to the Site Collection Images library.
By doing this, all pages which inherit from the top level default.master will be updated to reflect this change. Each time you create a sub site, simply inherit the master page of the parent site to ensure this behaviour remains in tact.