Get in Touch!




Customizing the Application.Master in MOSS

Recently, I was asked to customize the infamous application.master page for a web application.  The main goal behind this, is to carry the same look and feel across site pages and pages in the _layouts application.  Microsoft first said this method of customizing MOSS was unsupported up until a month or so ago.  Forgive me but I had the KB bookmarked but am failing to find it when writing this post.  I will post it once I find it.  smile

Shane points out that there some things to consider when editing the application master. I strongly agree with him and would not recommend editing the application.master with Sharepoint designer. Editing it with Sharepoint Designer means navigating to C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\Layouts and dragging the application.master into Sharepoint Designer to edit. Note, that there won’t be any versioning when editing this file even though you are editing it in SPD. The only thing you can do is edit the file and save it. Again, I would strongly recommend using Visual Studio or a Notepad ++ for this method. During the editing process, you might find it helpful to enable more friendly error messages in the event you delete a content place holder when editing this file.  Its very helpful to have a descriptive error message.


A more Standards Compliant MOSS Site

There are a couple of major things that I’m looking to achieve with this particular MOSS site I’m working on. It has to more standards compliant. Yes, you heard me- a more standards compliant moss site. At the least, this site will use a xhtml 1.0 transitional doctype to strict, CSS positioning, and hopefully CSS Adapters at some point. Even though the site won’t validate using the strict doctype it gives me peace of mind know I’m heading in that direction. Keep in mind, I will be using the web parts object model thorughout the site and using OOB web parts. To actually get the site to validate, I would have to not use OOB web parts all together and implement custom user controls. CSS Adapters can be implemented by using the steps outlined by Mossman.  As always, Mossman did a great job walking through the necessary steps to get this to work on your MOSS site.


Getting to the Content Place Holders

To start things off, I recommend making a copy of the application.master incase you make any mistakes and cannot fix them. While retaining all the of the core .net elements on the page, I began removing all the unwanted table tags being used for positioning. I’m going to be using a 2 column layout which I can mimic perfectly well using CSS positioning. It will render in IE6+, FF, Opera, and Safari. The majority of articles I have read express their disinterest in cleaning up the application.master because its not public facing. Of course, my natural response was, “Why Not?” Once all of the table elements are removed, I render the application.master in my browser and everything appears to be working. I am not presented with any error pages. I take unwanted asp:ContentPlaceHolders and move them to a hidden panel. This method is exactly the same as removing asp:ContentPlaceHolders from your master pages (i.e. Microsoft’s Minimal Master Page). I then take the necessary content place holders and positioning them according to my design I’ve mocked up. Note, the Main navigation control combines the “Site Actions” control on application.master page. This leaves you with the inability to move the “Site Actions” to a specific location. Personally, I’m willing to take a hit for this as these pages are mostly viewed by a small group of people using the site and not the typical end user. That is pretty much it! There is really nothing to it. I hope you enjoyed reading my experience with customizing the application.master.


Download

Get my bare bones application.master page to start your own customizations. This master page works just fine. I have added a xhtml 1.0 transitional doctype, commented the majority of the placeholders for easier use, and cleaned up some missing quotes and such.



Posted by Bryan on 01/30 at 01:42 PM in WorkMOSS 2007 • (1) Comments

Comments

#1. Posted by creditcards bad on September 17, 2008

Very Nice Site! Thanx!

Name:

Email:

URL:

Comments:

Remember my personal information

Notify me of follow-up comments?

Weblog Categories

Monthly Archives

Syndicate Weblog