Article Categories
Archives
Post Categories
  Jump to Information for:
Search:  

Minimal or Base Master Pages


The following is a collection of stripped down master pages for your use with SharePoint 2007 sites. The master pages that ship with SharePoint (default.master, blueband.master, etc) are full of formatting code for the respective design for the master page, so to create your own master page you have to copy a master page and strip out all of formatting code (HTML, etc) in the file. With these base master pages, I have done that step for you, plus included comments tagging the Content Placeholders so you quickly identify the Content Placeholders and handle them how you see fit.

Below are some commonly asked questions, and a few notes about the file.

PLEASE NOTE

Please note that the base master pages include the HTML Transitional DTD that will display your site in quirks mode.  Please replace the DTD if you need a more refined presentation mode for your site. A bit more info... or a lot more info.

FAQ

  1. What is a Master Page?
    Please read this post: MOSS 2007 Design Component Relationships and Diagrams.  
  2. Hey, can't I just create my own master page?
    Sure, but it is a long process. There is a set of Content Placeholders that must be included in your master page in order for it to run in SharePoint. The point of the base master pages is to provide you with that set of Content Placeholders without all of the formatting code.  
  3. OK I downloaded this code, now what?
    Create a master page in your development SharePoint site. Paste in the base master page code (in lieu of the code that is added when the file is created) and save the file to your master page gallery. I suggest using SharePoint Designer to complete these actions. In your site, apply the master page in Site Settings. View your page. Your site should now show just the Content Placeholders.  
  4. Gak! My site looks weird now, everything is just stacked on top of each other!
    Yup, the base master page has no formatting code. Take a look at your master page file and you will just see Content Placeholders. Now it is up to you to add HTML and the like to format your site. It is like putting together a puzzle, you will need to add your formatting code and piece in the Content Placeholders where you need the various SharePoint elements.  
  5. There are Content Placeholders I don't want in my site, what do i do?
    Don't delete them! The Content Placeholders have to stay in the file for SharePoint to run. If there is a Content Placeholder you don't want to use, move the code to the hidden ASP Panel located at the bottom of the file. This is a nifty trick, the ASP Panel has the visibility set to false, so while the Content Placeholders are included in the file (and ultimately your site) everything is hidden from view. You can place as few or as many Content Placeholders in this hidden panel as you like.  
  6. The base master page still has some stuff that looks like SharePoint, why is that happening?
    If you take a look at the screen shots for each base master page or at your site after applying it, there are some items that still look like SharePoint such as navigation and the web part title bars. This is because the user controls that control these elements include CSS styles outside of the master page. In order to update the look and feel of these items, you need to override the CSS that is being used for the elements. Use my CSS reference chart to help with this process.

    AND THE NUMBER ONE QUESTION I GET:

  7. I applied the base master page, but when I view my site, I get an error.
    If all you have done is paste in my base code, make sure that the Registry tags in the top of the file still has some tildes in some key spots. Anywhere there is a reference to /_controltemplates, there should be a tilde (~) before the forward slash. Avoid losing these tildes by opening the base master page file in another application other than SharePoint Designer (such as Visual Studio or Notepad) and copying the code from there for your paste into your new master page file in SharePoint Designer. See below for a code sample. 

     <%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %> 

     If you have started moving around Content Placeholders and editing the file and you get a site error, you have probably deleted a neccessary Content Placeholder or accidentally edited something to make the Content Placeholder invalid. The best thing to do is to turn off friendly error messages for your site and view the page again. Then SharePoint will tell you exactly what it is hanging up on. See the end of this page for instructions on how to turn off friendly error messages for your site.

For each base master page, there is a link to the code, and a link to a sample screen shot of what your site will look like after applying the master page code.

MOSS Collaboration Site Base Master Page AND WSS Base Master Page

There is no difference between master pages for a collaboration MOSS site and a WSS site.

MOSS Publishing Site Base Master Page

Turn off Friendly Errors

While in development, the friendly error page that SharePoint displays when your page has an error can make debugging your master page issues very difficult. You can make an easy change to your Web config file for the site to turn friendly error messages off, therefore providing you with more useful information if your page breaks. Only do the following in a development environment, you would never want to turn off friendly error messages in a production environment. Also be sure to make a back up of the file prior to editing.

  1. On the Web server, navigate to the site directory:
    Local Drive:\Inetpub\wwwroot\wss\VirtualDirectories\[directory for site] (for example 84)
  2. Open Web.config in Notepad.
  3. Search for "CallStack". Change the CallStack status to "true".
    <SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
  4. Search for "CustomErrors". Change the mode to "off".
    <customErrors mode="Off" />
  5. Save and close the file.
Now when your site encounters an error, you will receive a .NET screen outlining the issue instead of the friendly SharePoint error screen. This is particularly useful with dealing with missing Content Placeholders and editing Master Pages. To turn friendly error messages back on, just walk through these steps setting the CallStack to false and CustomErrors mode to On.
posted on Thursday, June 07, 2007 9:54 AM
Comments
  • # re: Base Master Pages
    The Mossman
    Posted @ 6/7/2007 1:04 PM
    Oooh, this minimal publishing master could have really helped me about 3 months ago!
  • # re: Base Master Pages
    Chris Dira
    Posted @ 6/7/2007 10:53 PM
    Heather,

    As usual, your instructions are excellent and to the point. These set of instructions should allow any baseline html designer to incorporate a good design layout for sharepoint. Thanks!

    Chris
    www.moss07.org
  •  re: Base Master Pages
    Johnny Brunson
    Posted @ 6/25/2007 9:38 AM
    Thanks for all your hard work Heather, those of us just digging in really appreciate all you do.

    Definately looking forward to the WSS Base Master Page addition here.
  •  re: Base Master Pages
    Agnes Hodgson
    Posted @ 7/3/2007 1:52 PM
    I am working with MOSS and have the master working exactly as expected except....... all of the pages that have _layouts in the URL do not pick up the new master page, seems style sheets are carried through but not the master page.

    Example URLs:
    http://server/_layouts/settings.aspx

    http://server/site/_layouts/viewlsts.aspx?BaseType=1

    Is there a step I have missed?

    Thanks
  • # re: Base Master Pages
    Isaiah
    Posted @ 7/11/2007 3:35 PM
    Wow this is awesome, thank you so much for all your work!
  •  re: Base Master Pages
    mmeija
    Posted @ 7/11/2007 5:23 PM
    thank you thank you
  •  Content types Columns
    Sham
    Posted @ 7/12/2007 5:42 PM
    I created a a site column with unexpected results; The column that i created was replicated throught my site, even to the templates. I created a column named SiteID. After I saved this, the entire site that referenced the contacts template as well as the templates themselves, have the the SiteID colm instead of Title or Name column
  •  re: Base Master Pages
    Crist
    Posted @ 7/13/2007 4:39 AM
    Hi Heather,

    Great Blog you have here, i´m learning a lot (newbie in sharepoint :o))!

    And how about the nested master pages, is it the same? I was trying to build a master page without left navigator, only whit the header, and the rest in my page layout, is that possible?

    Thks
    Crist
  • # re: Base Master Pages
    Jason Miller
    Posted @ 7/15/2007 3:45 PM
    Always great information Heather!

    I have a quick question about changing another error page. I am trying o find out where to change the default error page look and feel that SharePoint gives on many of it's internal errors such as "Unknown Error" or "You are not allowed to respond again to this survey. ".

    The page seems to ignore the Master page and is very basic. Can you please tell me how to change this?

    Thanks,
    Jason
  •  re: Base Master Pages
    Jereme Watts
    Posted @ 7/26/2007 2:07 PM
    thanks for the updated comments, good post Heather can't wait to meet you in Vegas...
  •  re: Base Master Pages
    Shiva Kumar
    Posted @ 7/30/2007 5:59 AM
    Hi Heather,

    Is the base master page different for different site definitions? When I check through SharePoint Designer all the site defs have exact master page. Where as in your post you have mentioned two different master pages for different site defs.

    Regards,
    Shiva
  • # re: Base Master Pages
    Kanwal
    Posted @ 7/30/2007 10:26 AM
    Appreciate what you have provided here. the Base Master page has definitely helped me get up and running. Oddly, the minimal page that MS offers wasnt working.

    Thank you Heather!
  •  re: Base Master Pages
    R Hackett
    Posted @ 8/2/2007 5:04 PM
    HI,
    I'm trying to do something similar to your Collaboration site base page.

    I noticed as I was working that teh Left Nav items(Quick launch etc) don't have a __designer attribute unitl I used a HTML comment to remove that section from the screen. Suddenly I was getting errors on my site and I noticed the file had literally doubled in size.
    The error was cannot convert 'Microsoft.SharePoint.WebControls.EncodedLiteral' to
    'System.Web.UI.IAttributeAccessor'

    I notice you have the same __designer attributes, did you get a similar problem?
    Any ideas where this is being put in eg Designer, Sharepoint checkin?

    Cool post
  •  re: Base Master Pages
    Chris
    Posted @ 8/9/2007 9:40 AM
    Thanks for the info!
  •  re: Base Master Pages
    John Bellew
    Posted @ 8/20/2007 5:00 AM
    Most excellent
  • # re: Base Master Pages
    Sadalit
    Posted @ 9/18/2007 1:10 PM
    You are the only one I've seen who has passed on that bit about putting the tildes back in to solve the errors. You are my hero. Thanks very much for this excellent base master page.
  •  re: Base Master Pages
    Adrian
    Posted @ 10/1/2007 1:41 AM
    Your blog about this Base Master Pages helped me a lot. thank you! Master
  •  re: Base Master Pages
    paisleygo
    Posted @ 11/27/2007 4:48 PM
    I am having a hard time getting the changes to show up - I open the newmaster.master file - make the changes and save, then I go to the sharepoint site and hit f5 but nothing shows I also tried going through the 'publish' process - but still no changes - i remember you mentioning this in class - but don't remember what the trick was - can you remind me?

    Thanks for this lovely bit of clean code - very helpful

  •  You have missed a critical step...
    Alan
    Posted @ 12/3/2007 10:50 AM
    Hello:

    While this site is a breath of fresh air over any Microsoft site, concerning customizing Sharepoint Master Pages and just explaining all the classes and such in a Master Page, as a writer, it drives me nuts when I see critical steps missing.

    In this case, you mention "Paste in the base master page code". What 'base master page code'???? You elide completely over this critical step! Ack. Very frustrating. It turns a potentially excellent 5 star article, into abject failure based on your goal of explaining how to 'customize master pages'.

    This site would be much better also, if you actually showed a couple of example master pages *with* css code. In fact, I would venture you would receive way more revenues and page views both for your consulting and from ads on the page, if you had done this.
  •  re: Base Master Pages
    JC
    Posted @ 12/9/2007 9:29 PM
    When I click on "Site Actions", the link to edit the page doesn't appear. Anyone know why?
  •  re: Base Master Pages
    Don
    Posted @ 12/20/2007 5:10 PM
    Hi,

    I looking for a place to buy a Master page for my companies MOSS site. Is there any place where I can find pre-made master pages where I can just drop in a logo on to. Or even just make some minor adjustments. We are looking to setup a site fast and not use defaults provided by Microsoft. Any info would be great.


  • # re: Base Master Pages
    Adrian
    Posted @ 12/20/2007 11:57 PM
    Hi Heather,
    Thanks for your base master page, it came in handy in the initial stages of branding my department's new website. The new site is supposed to be XHTML compliant, but, fat chance, because quite a few of the SharePoint controls are sealed, so I cant override their render methods to make them XHTML compliant. Very annoying but what can I do about it? I already whinged to MS.

    Anyway, I had a quick question... My master page now looks beautiful with all my custom menus etc in it, but it has some problems when acting as a "System Master Page". I understand that these system master pages ("default master page" in SharePoint designer) require extra or different code over the custom master pages. For most uses, like displaying a list when logged in, and approving things, etc, the master works fine. But certain pages, eg a "Properties" page for a list, I get script errors in the browser!!! I was wondering if you knew anything about making a System Master Page function as expected. I really can't see where my master is missing anything over one of the out of the box ones. Very frustrating! And I can't find any info anywhere on this topic.....

    Thanks for your time
    -Adrian
  •  re: Base Master Pages
    Drew
    Posted @ 1/18/2008 11:38 AM
    Hi Heather,
    I have a site that looks good in a normal browser but needs help when you go to a mobile browser. Do you have any good CSS files for working with mobile browsers.
  •  re: Base Master Pages
    Mike
    Posted @ 1/27/2008 8:27 AM
    Hi! i found a lot of films here, of course if you are using rapidshare premium account http://loadingvault.com
    No over rapidshare crawlers can be compared with Loadingvault.com. Loadingvault.com is a best rapidshare search engine.
  •  re: Base Master Pages
    Dianna
    Posted @ 2/7/2008 12:11 PM
    Heather -

    This is fabulous. I've downloaded the current base master page, opened in textpad, then copied into SPD. Unfortunately, I'm getting quite a few "Error Creating Control - unknown server tag" errors.

    Is there something I'm missing?

    Thanks so much!
    Dianna
  • # re: Base Master Pages
    Thomas
    Posted @ 2/14/2008 11:41 AM
    This is awesome! Thanks for this freebie, I know it had to have taken you forever to do.
  •  re: Base Master Pages
    Mike Sharp
    Posted @ 2/26/2008 6:03 PM
    Hi Heather,

    I noticed you have a rogue </div> tag in your base master page at the end of the SharePoint:SPLinkButton control in PlaceHolderLeftNavBar.

    It's the closing div to <div class="ms-quicklaunchheader">

    Regards,
    Mike Sharp
  •  re: Base Master Pages
    Reetha
    Posted @ 3/19/2008 2:02 AM
    I am not able to view my master page gallery while i am trying to open my site in sharepoint designer 2007 .Then i tried to open that page in sharepoint designer through the browser also,then its showing a message like "The document could not be opened for editing.A windows sharepoint services compatible application could not be found tio edit the document.


    Please advise me how can i solve this issue.
  • # re: Base Master Pages
    Rapidshare
    Posted @ 4/1/2008 9:12 AM
    I completely agree with all that here is told
    Your blog about this Base Master Pages helped me a lot. thank you! Master
  •  re: Base Master Pages
    Jerry Hughes
    Posted @ 4/3/2008 6:26 AM
    Hi ~
    I have been experiencing some master page issues. I created a master page layout in one site that I LOVE. I want to save that master page to a completely different site...

    Copying the default.master page from one site and pasting it over the default.mater of another site isn't working? Thoughts?
  •  re: Base Master Pages
    Jill
    Posted @ 4/15/2008 11:49 AM
    Can a master page be designed with a <div> tag layout versus a <table> tag layout? The reason I ask is for accessibility reasons.
  •  re: Base Master Pages
    Gurmeet
    Posted @ 4/24/2008 2:30 PM
    Hi,

    How can we have different Master Pages for a Site ? e.g. HomePage, SubPages etc.

    The homepage of my site is totally different then the other sub pages. If I make Custom Master for my sub pages, and apply it to the whole site, then how will I make my HomePage?

    There is nothing common among the homepage & sub pages.

    Please help, would appreciate your quick help. I am desperate !!

    Thanks,

    Gurmeet
  • # re: Base Master Pages
    Mark
    Posted @ 5/21/2008 4:44 PM
    I followed the instructions for starting to use this example of the minimal master page. I just brought in the page. And applied to a web page and got this error.

    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

    I am doing this for publishing site.
    I checked all the tildas and they are there.
  •  re: Base Master Pages
    Brian
    Posted @ 6/19/2008 7:14 AM
    The DOCTYPE tag in both of your masters uses smart quotes.
    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

    Minor, but should be changed to standard quotes to be safe.
Title  
Name  
Email (never displayed)
Url
Comments   
ALL COMMENTS ARE MODERATED! Sorry for the inconvenience, but it is how I keep all of the spam and advertisers out. I moderate comments about once a week and your comment will appear soon. Thanks for posting!
Please add 7 and 7 and type the answer here:

Copyright © 2005-2008. Heather Solomon.
Site design by Heather Solomon

Blog Stats:
Posts - 365
Stories - 37
Comments - 1303
Trackbacks - 182