Application master page files in SharePoint 2010

2

Category : SharePoint 2010

The bane of my existence, in branding SharePoint 2007 sites, is the application.master page. They always cause me issues. Microsoft made a clear path to creating custom master pages for a SharePoint site, but completely left out application pages. Of course, SharePoint developers figured this out and use custom http modules http://www.greggalipeau.com/2008/06/19/customizing-applicationmaster/. However, that is a pain to do because it means creating two separate master pages for one application (really defeats the purpose of master pages). Not to mention there are all kinds of issues with creating application.master pages (my favorite is how some application pages break when Ajax functionality was implemented).
Thus, I was extremely happy when I saw the ability to update the application master page in SharePoint 2010. I took a look at one of the application pages and noticed the following tag: “DynamicMasterPageFile”. This setting uses the same concepts of regular SharePoint pages in relation to master pages. No more custom application master pages needed!
Oh happy day! Loving SharePoint 2010 more and more every time I use it. I hope all my clients upgrade soon.

Post to Twitter

Comments (2)

After a SharePoint upgrade, what is the best way to deal with the module no longer working?

i.e. my settings.aspx pages (admin pages) have DynamicMasterPageFile=”~masterurl/default.master” within them however they are actually using layoutsv3.master

Why is this happening? thx

Hi David,
~masterurl/default.master is what they call a dynamic token in SharePoint. It is not a physical path. SharePoint actually does a string replacement at runtime to replace default.master with layoutsv3.master. The reason they do this is so you can change the masterpage in the UI (assuming you are running SharePoint Server and not just SharePoint Foundation). It’s a very nice thing to be able to switch master pages in the UI under Site Settings – Master Pages.
For more information on dynamic tokens, check out a magazine article I wrote for SharePoint 2007. It is the same concept in 2010. http://sharepointmagazine.net/technical/development/examining-the-out-of-the-box-master-pages-in-sharepoint

Post a comment