Project Description
Global Navigation for WSS 3/MOSS 2007 across site collections and across content databases and provisioning pop-up window on desired menu items by using simple attributes in sitemap file .

This is classis example of extending custom attributes in your sitemap file and tweak MOSSMenu base code attached in this project to read those attributes and render menu's accordingly.

If you have any questions or concerns, please feel free to contact me at venkyweb@yahoo.com for review and follow-up on your global MOSS Global Navigation requirements across your site collections across content databases.

This project is very helpfull for people who migrated SPS 2003 to MOSS 2007 with many content databases across site collections in your server farm.

Quick wrap up on Global Navigation what I have at this moment out of my memory bank. Stay tuned for full article and source code ...

1. The solution is around custom sample xml file called appbin/GlobalMenu.sitemap in front end web application(vdir in IIS 6.0). You need to include desired site menu structure for your enterprise. Make sure this file is bug free from XML parser by open file with internet browser.

Refer to attached sample file GlobalMenu.sitemap along with source code project

<siteMap>
<siteMapNode title='Home' url='/'>
<siteMapNode title="Services" url="/Services/default.aspx" target="_new">
<siteMapNode title="Time and Expense" url="/Time and Expense/default.aspx" target="new" popupwidth="400" popupheight="600" popup="/Time and Expense/default.aspx"*/>
<siteMapNode title="Human Resouces" url="/Human Resouces/default.aspx"/>
<siteMapNode title="Research" url="/Research/default.aspx"/>
</siteMapNode>
<siteMapNode title="Research" url="/Research/default.aspx">
<siteMapNode title="Global Research" url="/Research/Global/default.aspx" target="_new" />
<siteMapNode title="Local Research" url="/Research/Global/default.aspx"/>
<siteMapNode title="Public Sector" url="/Research/Public Sector/default.aspx"/>
</siteMapNode>
</siteMapNode>
</siteMap>

2. Install MOSSMenu if you want to customise menu items to new popup window as target than default _top window

/// Source Blog: blogs.MSDN.com
/// http://blogs.msdn.com/ecm/archive/2006/12/02/customizing-the-wss-3-0-moss-2007-menu-control-mossmenu-source-code-released.aspx
/// Original Code Release Date: Saturday, December 02, 2006 5:37 PM
///
/// Note: MossMenu is provided as is and will only work on sites built with WSS 3.0 or MOSS 2007.
/// MossMenu relies on some JavaScript which has been included along with the C# source.
/// This is really just for completeness’ sake aside: some trival about the use of the apostrophe for
/// the possessive forms of nouns
as this script is automatically included on most pages through the
/// core.js script include reference.
///
/// Enhancement Author: Venkatesam Miriyapalli (Venky) venkyweb@yahoo.com
/// Date: 09-21-2008
/// This code has been enhanced to cater popup window for desired Global Navigation menu Items.
///
/// If you want out of the box open source code please go to below site
/// http://blogs.msdn.com/ecm/attachment/1193956.ashx

3. Provision Master page yourmaster.master or cross site collection master page feature ...

Refer to attached sample file yourcustom.master along with source code project

<Sharepoint:MossMenu
ID="TopNavigationMenu"
Runat="server"
DataSourceID="xmlSiteMap"
EnableViewState="false"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
Orientation="Horizontal"
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"
DynamicHorizontalOffset="0"
StaticPopoutImageUrl="/_layouts/images/menudark.gif"
StaticPopoutImageTextFormatString=""
DynamicHoverStyle-BackColor="#CBE3F0"
SkipLinkText=""
StaticSubMenuIndent="0"
CssClass="ms-topNavContainer">
<StaticMenuStyle/>
<StaticMenuItemStyle CssClass="ms-topnav" ItemSpacing="0px"/>
<StaticSelectedStyle CssClass="ms-topnavselected" />
<StaticHoverStyle CssClass="ms-topNavHover" />
<DynamicMenuStyle BackColor="#F2F3F4" BorderColor="#A7B4CE" BorderWidth="1px"/>
<DynamicMenuItemStyle CssClass="ms-topNavFlyOuts"/>
<DynamicHoverStyle CssClass="ms-topNavFlyOutsHover"/>
<DynamicSelectedStyle CssClass="ms-topNavFlyOutsSelected"/>

</Sharepoint:MossMenu>

<!-- new XML site map -->
<SharePoint:DelegateControl runat="server" ControlId="XmlNavigationDataSource">
<Template_Controls>
<asp:SiteMapDataSource id="xmlSiteMap" ShowStartingNode="true" SiteMapProvider="CustomXmlContentMapProvider" runat="server"/>
</Template_Controls>
</SharePoint:DelegateControl>

4. In web.config of Front-End application

Refer to attached sample file web.config along with source code project

<SafeControl Assembly="MossMenu, Version=1.0.0.0, Culture=neutral, PublicKeyToken=672db77638371ca3" Namespace="Microsoft.SDK.SharePointServer.Samples" TypeName="*" Safe="True" AllowRemoteDesigner="True"/>

<siteMap defaultProvider="CurrentNavSiteMapProvider" enabled="true">
<providers>
<add name="CustomXmlContentMapProvider" siteMapFile="appbin/GlobalMenu.sitemap" type="Microsoft.SharePoint.Navigation.SPXmlContentMapProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
....
</providers>
</siteMap>

5. Make sure you have Trust attribute during your development at first to make it work then you can change to code access security and tweak desired permission. I will update soon with those details in next update.

<!--<trust level="WSS_Custom" originUrl="" />-->
<trust level="Full" originUrl="" />

6. IISRESET ...

Regards and Thanks,
Good Luck for your MOSS migrations and custom navigation solution.

I am very thankfull to all the colleague(s), client(s) and Microsoft's open source MOSSMenu code who have supported to build this custom solution and supported to publish this article.

Venky
Venkyweb@yahoo.com
CodePlex Member since: June 12, 2006

Last edited Sep 22, 2008 at 1:28 AM by venkyweb, version 9