Custom C# MOSS Navigation Using PortalSiteMapProvider

很早之前就一直想把SharePoint 的导航替换成自己想要的效果,之前也看了不少相关文章,这几天闲着没事就开始尝试做了下,经过不断尝试,终于做出来了,哈哈。。。

由于SharePoint 2007/2010的网站导航基本上基于标准的ASP.NET SiteMap模型,所以只要你对ASP.NET SiteMap有一些了解,就能创建一个自定义的导航菜单。

在开始之前,让我们先从网上随便找一个样子比较cool的菜单控件。在下面的示例中,我选择使用Smooth Navigation Menu这个jQuery控件,来渲染出SharePoint网站的顶部导航菜单。将Smooth Navigation Menu控件相关的.js、.css、.gif文件统统下载下来,我们将把它们都放进SharePoint项目中。(此效果跟Kaneboy做的效果一样);大家可以参考这篇文章尝试做下,http://blog.joycode.com/kaneboy/archives/2010/09/27/116080.joy

我做出来的效果如下:

这里我主要讲下PortalSiteMapProvider:

There are a few instances of the PSMP that are defined in the MOSS web.config that can be accessed through the PSM object:
PortalSiteMapProvider.CombinedNavSiteMapProvider: attached to the global or top nav menus
PortalSiteMapProvider.CurrentNavSiteMapProvider: attached to the current, or "Quick Launch" nav menu
PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode: attached to the breadcrumb nav
PortalSiteMapProvider.GlobalNavSiteMapProvider: Get the map for the global nav
PortalSiteMapProvider.WebSiteMapProvider: enumerates Web sites (SPWebs) in the site collection

参考资料:

http://blog.richfinn.net/blog/2007/08/14/CustomCMOSSNavigationUsingPortalSiteMapProvider.aspx

原文地址:https://www.cnblogs.com/KingStar/p/1917904.html