Click here to Skip to main content
15,897,184 members
Articles / Web Development / XHTML

SharePoint Custom Site Navigation

Rate me:
Please Sign up or sign in to vote.
3.00/5 (2 votes)
12 May 2008BSD2 min read 132.7K   393   32  
This articles provides an overview on how to do customized site navigation on MOSS publishing sites.
<%@ Master Language="C#" Inherits="PrestoFX.MasterPages.PrestoFX, PrestoFX.MasterPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a59fa9b8fa6091cc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" Src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" Src="~/_controltemplates/DesignModeConsole.ascx" %>
<%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" Src="~/_controltemplates/VariationsLabelMenu.ascx" %>
<%@ Register TagPrefix="PublishingConsole" TagName="Console" Src="~/_controltemplates/PublishingConsole.ascx" %>
<%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" Src="~/_controltemplates/PublishingActionMenu.ascx" %>
<html>
<head id="Head1" runat="server">
    <meta name="GENERATOR" content="Microsoft SharePoint">
    <meta name="progid" content="SharePoint.WebPartPage.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Expires" content="0">
    <SharePoint:RobotsMetaTag ID="RobotsMetaTag1" runat="server" />
    <asp:ContentPlaceHolder runat="server" ID="head">
        <title>
            <asp:ContentPlaceHolder ID="PlaceHolderPageTitle" runat="server" />
        </title>
    </asp:ContentPlaceHolder>
    <SharePoint:CssLink ID="CssLink1" runat="server" />
    <SharePoint:CssRegistration ID="CssRegistration" Name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/PrestoFX.css %>" runat="server" />
    <SharePoint:Theme ID="Theme1" runat="server" />
    <SharePoint:ScriptLink ID="ScriptLink1" Language="javascript" Name="core.js" Defer="true"
        runat="server" />
    <SharePoint:CustomJSUrl ID="CustomJSUrl1" runat="server" />
    <SharePoint:SoapDiscoveryLink ID="SoapDiscoveryLink1" runat="server" />
    <asp:ContentPlaceHolder ID="PlaceHolderAdditionalPageHead" runat="server" />
    <script type="text/javascript" language="javascript" src="/_layouts/1033/PickerTreeDialog.js"></script>
    <SharePoint:DelegateControl ID="DelegateControl1" runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true" />
</head>
<%-- When loading the body of the .master page, MOSS 2007 also loads the SpBodyOnLoadWrapper class. This class handles .js calls for the master page. --%>
<body onload="javascript:_spBodyOnLoadWrapper();">
    <%-- The SPWebPartManager manages all of the Web part controls, functionality, and events that occur on a Web page. --%>
    <form id="Form1" runat="server" onsubmit="return _spFormOnSubmitWrapper();">
    <WebPartPages:SPWebPartManager runat="server" ID="m" />
    <SharePoint:FormDigest ID="FormDigest1" runat="server" />
    <div id="PrestoFXBodyDiv" runat="server" class="body">
        <table width="100%">
            <tr>
                <td>
                    <!--Start of Top Banner -->
                    <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" StaticEnableDefaultPopOutImage="false" CssClass="menu">
                        <LevelMenuItemStyles>
                            <asp:MenuItemStyle CssClass="menuitem"/>
                            <asp:MenuItemStyle CssClass="menuitem"/>
                        </LevelMenuItemStyles>
                    </asp:Menu> 
                    <!--End of Top Banner-->
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td colspan="2" class="authoringRegion" align="right">
                    <span class="siteActionMenu">
                        <PublishingSiteAction:SiteActionMenu runat="server" />
                    </span>
                </td>
            </tr>
            <tr>
                <td style="width: 153px; padding-right: 10px;" valign="top">
                    <!-- Start Left Menu -->
                    <asp:ContentPlaceHolder ID="PlaceHolderLeftActions" runat="server">
                    </asp:ContentPlaceHolder>
                    <asp:ContentPlaceHolder ID="PlaceHolderLeftNavBar" runat="server">
                    
                    </asp:ContentPlaceHolder>
                    <br />
                    <br />
                    <asp:ContentPlaceHolder ID="PlaceHolderCalendarNavigator" runat="server" />
                    <!-- End Left Menu -->
                </td>
                <td valign="top" style="width: 100%">
                    <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <!-- Start Publishing Console -->
                                <PublishingWebControls:AuthoringContainer ID="authoringcontrols" runat="server">
                                    <PublishingConsole:Console runat="server" />
                                </PublishingWebControls:AuthoringContainer>
                                <asp:ContentPlaceHolder ID="WSSDesignConsole" runat="server">
                                    <wssuc:DesignModeConsole id="IdDesignModeConsole" runat="server" />
                                </asp:ContentPlaceHolder>
                                <!-- End Publishing Console -->
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                        <td nowrap>
                                            <!-- Start Navigational Breadcrumbs -->
                                            
                                            <!-- End Navigational Breadcrumbs -->
                                        </td>
                                        <td nowrap align="right" width="100%">
                                            
                                        </td>
                                        <td class="ms-titlearearight">
                                            <asp:ContentPlaceHolder ID="PlaceHolderMiniConsole" runat="server" />
                                        </td>
                                    </tr>
                                    
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                <!-- Start Main Content -->
                                <asp:ContentPlaceHolder ID="PlaceHolderMain" runat="server" />
                                <!-- End Main Content -->
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    <asp:ContentPlaceHolder ID="PlaceHolderBodyRightMargin" runat="server" />
                </td>
            </tr>
        </table>
    </div>
    <asp:Panel ID="Panel1" Visible="false" runat="server">
        <%-- These ContentPlaceHolders are only necessary to ensure all out of the box MOSS 2007 pages render with this master page. If the system master page is set to any default master page, the only content placeholders required are those that are overridden by your page layouts. --%>
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescription" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageTitleInTitleArea" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderSearchArea" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderBodyAreaClass" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleAreaClass" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderLeftNavBarTop" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderNavSpacer" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleRightMargin" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleBreadcrumb" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderSiteName" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescriptionRowAttr" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescriptionRowAttr2" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderDialogTitleInTitleArea" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderHelpLink" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderDialogBodySection" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderDialogImage" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderDialogHeaderPageTitle" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderGlobalNavigation" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTopNavBar" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderDialogButtonSection" runat="server" />
    </asp:Panel>
    </form>
    <asp:ContentPlaceHolder ID="PlaceHolderUtilityContent" runat="server" />
    <div id="ctl00_PlaceHolderMain_ctl19" style="display: none">
    </div>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License


Written By
Team Leader Avanade
United Kingdom United Kingdom
Thoroughly convinced by the simplicity of C# and the richness of the base class library, Jiang moved from Java/C++ to the Microsoft .NET platform after having completed his computer science degree. A few years into your run-of-the-mill business reporting projects, he discovered the fun of working with SharePoint and has since been more and more enamored with the breadth of the product. Sadly to say, not all projects involve heroic debugging sessions with parallel and concurrent programming and sometimes SharePoint designer is all he gets to plays with.

Comments and Discussions