I have been a bit slow in posting on this series. Enjoying my holidays and relaxing most of the time :) Here is another installment of this series.
I will focus on one very important item of SharePoint branding. AlternateHeader.
You can brand pages from different templates, so as to give different look on sites / areas created from different templates. But what about the pages in /_layouts/1033 directory. These are common for all the templates, and as soon as the user hits any of these pages, they would hit the common pages.
Some of the pages in the _layouts directory have code to support the alternate header functionality.
In the page you will find a code block like this:
<%
string alternateHeader = SPControl.GetContextWeb(Context).AlternateHeader;
if (alternateHeader == null || alternateHeader == "")
{
%>
<TR>
…… code which is to be used if the alternate header is not defined
…… goes here.
</TR>
<%
}
else
{
Server.Execute(alternateHeader);
}
%>
This is a very nice way to brand these pages to have different look and feel when accessed from different template pages. The page to use as the alternate header, is definied in the onet.xml for the template concerned. Be careful and get this right before you create your site with that template, as it cannot be changed by modifying the template once the site is created. So before you start your sharepoint deployment it is essential that you get your alternate headers definited properly in the onet.xml.
Basically, have an alternate header for each template you have. This will let to assign an alternate header to pages from from templates in a 1:1 relationship.
E.g. Say you have several team sites with different branding, HR Site, Finance Site and Sales Site. You have created 3 templates for these 3 site types. Now your goals is to provide a seamless interface to the user whenever the user is presented any page from the _layouts/1033 directory, like viewlsts.aspx which is presented when the user tried to see the documents & lists in any site, or create.aspx when the user is trying to create a list.
Before you create your HR, Finance or Sales site, you will be creating 3 templates which would deifine the different branding of these 3 sites. It is essential that you plan ahead and assign different alternate headers in the onet.xml of these templates. In the <Project> element you can add the attribute AlternateHeader="/_layouts/1033/HRAlternateHeader.aspx" in case of the HR Template.
Whenever a user opens a page in _layouts/1033 from a site created with the HR Template, he will see a page rendered with the header logic picked up from the HRAlternateHeader.aspx. This is provided the above code to include alternate header functionality is in that page. Not all pages from _layouts/1033 contain that code which is a bit of a pain. So for pages which do not have that code, you might want to edit them and add code support to use alternate headers if defined.
This will give you maximum flexibility while making good use of the excellent functionality provided by the AlternateHeader element. I will discuss creating and modifying templates in a later post.
For some providing more information on this alternate header functionality, see: