SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

PortalSiteMapProvider Properties: IncludePages, DynamicChildLimit

The PortalSiteMapProvider class is the base provider used by the four default "CMS" SiteMapProviders:

  • GlobalNavSiteMapProvider
  • CombinedNavSiteMapProvider
  • CurrentNavSiteMapProvider
  • CurrentNavSiteMapProviderNoEncode

That is, all of these SiteMapProviders use the same base code to generate a data source, but their "output" differs slightly due to the different attributes that are applied.

Recently, we wanted to filter out the pages from showing up in our left-navigation. You can do this at the rendering stage, but since the PortalSiteMapProvder gives us an IncludePages property, we can simply create a new entry in web.config for our "custom" provider, like this:

<add name="CurrentNavNoPagesSiteMapProvider" description="CMS provider for Current navigation" type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Current" EncodeOutput="true" IncludePages="Never" />

By default, there is also a 50 returned-items limit; we can set the DynamicChildLimit to "0" to override this.

<add name="CurrentNavNoLimitSiteMapProvider" description="CMS provider for Current navigation" type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Current" EncodeOutput="true" DynamicChildLimit="0" /> 

Of course, you can combine the different properties to come up with a combination you need. The next thing we would need to do is reference these new providers, and voila!

And if you haven't read Chris Richard's series of articles about MOSS Navigation and how to get better performance using the PortalSiteMapProvider, you really should...


Posted 10-22-2007 4:51 PM by Sherman

Comments

University Update-YouTube-PortalSiteMapProvider Properties: IncludePages, DynamicChildLimit wrote University Update-YouTube-PortalSiteMapProvider Properties: IncludePages, DynamicChildLimit
on 10-23-2007 1:49 AM

Pingback from  University Update-YouTube-PortalSiteMapProvider Properties: IncludePages, DynamicChildLimit

Up the limit – SiteMapProvider « Grumpy Wookie wrote Up the limit &ndash; SiteMapProvider &laquo; Grumpy Wookie
on 12-08-2008 6:05 AM

Pingback from  Up the limit &ndash; SiteMapProvider &laquo; Grumpy Wookie

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.