Ask a questionAsk a question
 

AnswerHow to change the theme of an error page

  • Monday, November 02, 2009 2:02 PMMindbenda Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,
    I use the 'simple' theme all over the WSS.
    But, when a user reaches a site where he/she has no rights the error page shows in another look.
    How can I change the look and feel of the error page according to the theme I use in the WSS?

Answers

All Replies

  • Tuesday, November 03, 2009 1:09 PMPaul Lucas Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hi,

    You will need to edit the master page "simple.master" located at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS

    In the head tag, between SharePoint:CssLink and SharePoint:ScriptLink add the SharePoint Theme control. for example

    	<SharePoint:CssLink runat="server" Alternate="false"/>
    	<SharePoint:Theme runat="server" />
    	<SharePoint:ScriptLink language="javascript" name="core.js" runat="server" />
    
    Hope this helps.

    Paul.




  • Tuesday, November 03, 2009 5:34 PMDave Hunter Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    It's a good idea to backup before making any changes to files in the 12 hive.  Also be careful with installing any service packs as they may overwrite your changes.  I would use one of this methods for updating files in the 12\template\layouts folder http://support.microsoft.com/default.aspx/kb/944105

    My SharePoint Blog - http://www.davehunter.co.uk/blog
  • Wednesday, November 04, 2009 12:19 PMMindbenda Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Gentlemen,

    I did the procedure #2 of the solution of Dave, meaning that I made a copy of the layouts dir and changed the Virtual Directory in IIS to look in the new layouts dir that I created. When I change the simple.master as Paul suggested I still get to see the error page without the theme I want to use.
    The errorpage that is shown seems to be located at another _layouts dir, namely:
    http://sharepoint/projecten/90003/_layouts/AccessDenied.aspx?Source=http%3A%2F%2Fsharepoint%2Fprojecten%2F90003%2Fdefault%2Easpx

    What am I missing and how can I change this?
  • Wednesday, November 04, 2009 12:39 PMMagnus Johansson Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi there.

    The best way to accomplish this and still adhere to Microsoft guidelines and service packs/hotfixes compatibility, is to write a custom HTTP module that will intercept the error page and redirect to a custom page of yours.
    This custom page may typically be a copy of the original error page, but it uses a custom master page and style sheet.

    Regards,
    Magnus
    My blog: InsomniacGeek.com
  • Wednesday, November 04, 2009 2:25 PMPaul Lucas Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Personally I would hope that Microsoft releases a service pack/hotfix that solves the problem and actually adds the theme support into these pages themselves.

    ;-)