Another day, another master page

Well, I’ve just built a lovely little HTTP Module that lets us redirect the application pages for a site or site collection to a new master page. I’m quite pleased, to be honest. Anyway, I noticed that the error pages in the site I was testing on were not using my new master page, so I started to examine this. I found that the error page (_layouts/error.aspx) is busy using simple.master. WTF?

It makes sense, I guess. You do need a master page which doesn’t run in an authenticated context, and a brief check shows that this is the master pages for the out-of-box Forms authentication page.

I decided to check out if there were other master pages in Layouts – and there were. My list of master pages is now:

  1. Default.master – used in normal sites. Often replaced for publishing sites.
  2. MwsDefault.master – use in Meeting Workspaces. Awkward to replace, but can be done through code or SharePoint designer.
  3. Application.master – used in ‘administration’ pages, and sometimes pages such as ‘View all site contents’, Recycle bin, and uploading a file.
  4. Simple.master – used in pages that need to run in an unauthenticated context – such as error pages, or forms authentication pages.
  5. sspadmin.master – seems to be used editing audiences, in excel services configuration, in profile administration, and handful of other places.
  6. layouts.master – no idea what this is for. Can’t find where it is used!
  7. dialog.master – used in the little pop-up dialogs, such as when you’re adding or editing a Hyperlink.
  8. pickerdialog.master – used in pop-up dialogs such as the web part gallery, or selecting users.

The master pages in italics are comparatively easy to replace; the rest are much more difficult. And try as I might, I couldn’t change the master page for Errors in my HTTP Module. I guess what I’ll do is write another one to redirect errors to my own custom-branded error page.

Advertisements
Another day, another master page

6 thoughts on “Another day, another master page

  1. Hi Andy,

    This was a useful post.

    Currently I am trying to add a ASPX page into SSP admin web application. All the SSP admin web apps as said uses sspadmin.master.

    Will i be able to use the same master page for my ASPX page?

    Thanks
    bekz

    Like

  2. Depends where you’re putting it.

    The SSP Site has a default.master – so if you’re putting it into the site, that would be the master page to use.

    Like

  3. I am putting my page in SSP and would like to use sspadmin.master. But I am finding difficulties in developing the ASPX page in visual studio.

    In case you have done such development can you share the information on how you development new ASPX pages using 3rd party master file in Visual studio.

    Regards
    bekz

    Like

  4. Hmm. If building pages to go in the SSP site (SPWeb) then I’d use SharePoint Designer, and then copy them out to package into a WSP.

    If you’re putting the pages into the _Layouts directory, well, then it’s just normal ASPX development. You could create a website project inside the _layouts directory (in a subfolder!) and chop out the bits you don’t need later. I’ve not tried that though; I rarely have to add pages to the _layouts, and when I do it’s normally only one or two.

    What’s the problem you’re having?

    Like

  5. Allan says:

    What is the benefit(s) of using an HTTP Module to redirect to a new MasterPage as opposed to just replacing the appropriate MasterPage?

    Like

  6. Certain master pages (those used by Application pages – all but the top two in the list above) exist in the _layouts directory. Changing those invalidates support from Microsoft; you’re really not supposed to.

    Worse, those files are used across your entire farm. Changing those files affects ALL sites in the farm.

    For example, one customer of ours had had another party in to do their branding for a particular department. They changed the application.master page in the _layouts directory. Now another department wanted to have some branding (and quite a different one too) – but all of their site settings pages, recycle bin, etc. had the first department’s branding too.

    By using an HTTPModule you can redirect requests for those master pages, and you can do so for particular sites, site collections, pages – whatever you choose, really.

    There’s a good post about this here:
    http://blogs.msdn.com/bgeoffro/archive/2007/11/12/branding-a-moss-corporate-intranet-portal-part-3-layouts-pages.aspx

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s