Partager via


Can I customize application.master and aspx files present under _layouts folder? - MOSS 2007 application pages customization

I had a support request from a customer the other day, who did some weird customization to his MOSS 2007 sites. Well, the support incident details did not have specific information on why he had logged this support call, so I called him. After the initial warm greeting with "Hi, how are you..." and stuffs like that, he showed me the remarkable customization he has been able to do with MOSS 2007 sites. "Why remarkable?" - well I don't particularly focus on sarcasm here, but I mean, really that guy had some pretty neat customization in place that I just asked him "Are we dealing with a SharePoint site at all?" - It was too good, polished and compact.

After giving the due complements his work deserved, I asked him what the problem was? He said he followed Customizing Master Pages in Windows SharePoint Services & How to: Create a Site Definition from an Existing Site Definition MSDN articles and a few other posts available online that really helped him a lot in doing what he did. But he said he has a concern. "Tell me customer, I am all ears!". What he said/asked wasn't really "shocking" to me, but I kind of felt the same pain the customer was perhaps in after hearing what he said (put yourself in customer's shoes - as they call it).

Well, the problem really was, though his SharePoint pages/sites reflect his customization, the SharePoint administration pages (those set of aspx pages & application.master file found under LAYOUTS folder) did not. He said, this was not the case in the previous version of SharePoint (SharePoint Portal Server 2003 & WSS V 2.0). I agreed with him and a "seasoned" support professional told him the technical reason for this behavior. The reason is that application pages follow a different (that's actually separate) master page to show itself up. It does not depend on site definitions to define how it should look anymore. I was able to convince him that it's for the good. I should say he also accepted it in a good sense. However, (because I put myself in his shoes) he probably felt that I could help further and I obliged as he told there is a "pressing" business requirement. I told him I'll try my best to help you.

It's unfortunate, application pages are now separated from site pages. I discussed with some colleagues and though they were as willing as I was to help, 898631 stopped us. Okay, we are at the end of a tunnel now, if I could suggest one best approach to customer it is this:

Just back up your LAYOUTS folder (so that you have it handy to revert back to out of the box files if MS support asks) and customize the files in LAYOUTS folder.

This is kind of accepted as this is the only way out if your requirement is to customize application pages. At least that's what I thought until I stumbled upon this article by Michael Yeager.

Actually, it's pretty neat way to customize application pages. See details from the above link, but in crisp, here it is:

  • Copy the TEMPLATE/LAYOUTS folder in TEMPLATE folder with a different name e.g., LAYOUTS<WEBAPPNAME>.
  • Open IIS Manager, expand the web site hosting SharePoint site in question. Right-click _layouts virtual directory, select Properties and use the "Browse..." button in "Home Directory" tab to change the path from LAYOUTS to LAYOUTS<WEBAPPNAME> folder.

(+) of this approach - as I see it:

  • Allows customization of application pages for individual SharePoint web sites.
  • Out of the Box files are intact.
  • Ability to revert back to out of the box installation if needed.

(-) of this approach - as I see it:

  • If public update/hotfix/SP, update files present under LAYOUTS folder, the application folder used by your "customized" SharePoint site will not be updated. If that's a critical update, there's a potential risk involved.
  • This approach might lead to excessive work in terms of managability and maintenance.

I suggested both these approaches to customer and left the "choice open" to him. He appreciated the effort and accepted this as a resolution for the support incident, but did not convey which approch he intends to take (which I was curious and interested in knowing). Anyway, another support incident closed as resolved. But I hope the above information was helpful as it was for this "creative" customer of mine.

Comments

  • Anonymous
    September 05, 2007
    PingBack from http://stevepietrekweblog.wordpress.com/2007/09/05/links-952007/

  • Anonymous
    October 27, 2007
    Well, I am not sure whether it is that great having the application pages separated from the site pages. I am currently looking for applying a scheme to a set of sites that I can administer, but I have no admin rights over the farm hosting the sites. No my problem is that I can't really add a theme - needs reset of IIS - can't use master pages, because the ones under _layout are not accessable. I am not quite sure whether SharePoint as a CMS makes a good solution at all. I have lately been experimenting with a lot of open source systems that use mySQL and PHP and I have to say that the way they are structured and documented is way above what I see with SharePoint... still looking for a solution for having a theme for my sites on that hosted farm...

  • Anonymous
    March 10, 2008
    I have a good solution to this issue. Read my blog about it at <a href="http://stephenkaye.blogspot.com/2008/03/how-to-customise-applicationmaster-file.html">http://stephenkaye.blogspot.com/2008/03/how-to-customise-applicationmaster-file.html</a>

  • Anonymous
    March 15, 2008
    I've developed  a solution to allow a site admin to specify an alternate url for the application.master per site.  This article explains how and provides wsp and source code. <a href="http://stephenkaye.blogspot.com/2008/03/how-to-customise-applicationmaster-file.html'>http://stephenkaye.blogspot.com/2008/03/how-to-customise-applicationmaster-file.html">http://stephenkaye.blogspot.com/2008/03/how-to-customise-applicationmaster-file.html</a>

  • Anonymous
    March 31, 2008
    So, looks like there is no recommended ways from Microsoft to customie those Application pages. Customers are left wide open :) and if they call back, MS will be deligeted to tell them that is not supported, another incident close - Lol

  • Anonymous
    April 03, 2008
    I have a feature that allows you to choose a different master page to substitute the standard application.master. It can be downloaded as a .wsp or as source code at <a href="http://stephenkaye.blogspot.com/2008/03/how-to-customise-applicationmaster-file.html">http://stephenkaye.blogspot.com/2008/03/how-to-customise-applicationmaster-file.html</a>

  • Anonymous
    July 08, 2009
    After following these instructions I get an error (with custom errors turned off) telling me that '/_layouts/_controltemplates/TopNavBar.ascx' does not exist. Any ideas why this is?

  • Anonymous
    January 06, 2010
    The comment has been removed

  • Anonymous
    March 21, 2010
    '/LAYOUTS/_controltemplates/TopNavBar.ascx' this error comes when you open the application pages in SPD then it changes the Path of Master page, so i resolved this issue by giving the exact path. change into:- MasterPageFile="simple.master" :)