in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

SPSherm.MyBlog

Sharing points about SharePoint...

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...

Comments

 

University Update-YouTube-PortalSiteMapProvider Properties: IncludePages, DynamicChildLimit said:

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

October 23, 2007 1:49 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts