AlternateHeader magic to style your SharePoint pages
Both in the portal and in team sites the underlying functionality is managed by an SPWeb. SPWeb functionality uses many generic ASPX pages defined in the folder Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS\1033. All pages in this directory look at the SPWeb property AlternateHeader. This property can be used to set the URL for an alternate .aspx page to use for rendering the top navigation area in SharePoint pages. Each ASPX page in this directory contains code to determine if the default header must be rendered or the specified header. it contains code like:
<%
string alternateHeader =
SPControl.GetContextWeb(Context).AlternateHeader;
if
(alternateHeader == null || alternateHeader == "")
{
%>
<TR><TD
WIDTH="100%" COLSPAN="3"><!--Top bar-->
<TABLE
class=ms-bannerframe cellSpacing=0 cellPadding=0
width="100%" border=0>
<TBODY>
<TR>
<TD
vAlign=center noWrap><IMG id=onetidHeadbnnr0
alt=Logo src="/_layouts/images/logo.gif"></TD>
<TD
class=ms-banner id=HBN100 vAlign=center noWrap
width="99%"><!--webbot Bot="Navigation"
startspan--><?XML:NAMESPACE PREFIX = SharePoint
/><SharePoint:Navigation runat="server"
LinkBarId="1002"></SharePoint:Navigation></TD>
<TD
class=ms-banner> </TD>
<TD
class=ms-banner style="PADDING-RIGHT: 7px"
noWrap><SharePoint:PortalConnection
runat="server"></SharePoint:PortalConnection></TD></TR></TBODY></TABLE></TD></TR>
<%
}
else
{
Server.Execute(alternateHeader);
}
%>
Normaly this AlternateHeader is empty, but all SPWebs underlying the areas in the portal have this property set to PortalHeader.aspx, and all MySites have this property set to MySiteHeader.aspx. These files can be found in the folder Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS\1033.
PortalHeader.aspx:
<%@ Page language="C#"
Inherits="Microsoft.SharePoint.Portal.SiteAdminPageNoBrowserCheck,Microsoft.SharePoint.Portal,Version=11.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"
%>
<%@ Register Tagprefix="SPSWC"
Namespace="Microsoft.SharePoint.Portal.WebControls"
Assembly="Microsoft.SharePoint.Portal, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint"
Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<tr>
<td colspan="3" width="100%">
<SPSWC:PageRedirectControl
runat="server" />
<SPSWC:ExternalHtmlResourceElement
runat="server" HtmlElement="StylesheetLink"
FileContext="SharedStyle" FileName="ows.css" />
<SPSWC:ExternalHtmlResourceElement
runat="server" HtmlElement="StylesheetLink"
FileContext="SharedStyle" FileName="menu.css" />
<SPSWC:ExternalHtmlResourceElement
runat="server" HtmlElement="StylesheetLink"
FileContext="SharedStyle" FileName="sps.css" />
<SPSWC:CustomCSSResourceElement
runat="server"/>
<SPSWC:PageHeader
id="PageHeaderID" runat="server" PageContext="SitePage"
ShowTitle="false" HelpID="NavBarHelpHome"/>
<div
class="ms-phnav1wrapper ms-navframe">
<SPSWC:CategoryNavigationWebPart runat="server"
id="HorizontalNavBar" DisplayStyle="HorizontalOneLayer"
/> </div>
</td> </tr>
MySiteHeader.aspx:
<%@ Register Tagprefix="SPSWC"
Namespace="Microsoft.SharePoint.Portal.WebControls"
Assembly="Microsoft.SharePoint.Portal, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint"
Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<SPSWC:PersonalSpaceNavigationResponse
runat="server" />
<tr><td colspan="3"
width="100%">
<SPSWC:PersonalSpaceNavigation
runat="server" />
</td> </tr>