Nick Porter's profileNick Porter - SharePoint...BlogLists Tools Help
    8/22/2008

    Microsoft Office SharePoint Server 2007 - SiteMapProviders


    The four main site map providers for Microsoft Office SharePoint Server 2007 specified in the web.config file, all inherit from the same type: Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider
     
    The main difference between these SiteMapProviders is the 'NavigationType' property.
    Every SiteMapProvider uses one of three different NavigationTypes. Global, Combined or Current.
     
    Global = Displays the same navigation as the parent site
    Current = Displays only the navigation items below the current site
    Combined = A combination of both Global and Current navigation

    Looking in the <Providers> section of the web.config file you will see the four main publishing navigation providers. The name of each provider corresponds to the NavigationType specified:
     
    GlobalNavSiteMapProvider
            <add name="GlobalNavSiteMapProvider" description="CMS provider for Global navigation"
    type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
    Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Global" EncodeOutput="true" />
     
    CombinedNavSiteMapProvider
            <add name="CombinedNavSiteMapProvider" description="CMS provider for Combined navigation"
    type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
    Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Combined" EncodeOutput="true" />
     
    CurrentNavSiteMapProvider
            <add name="CurrentNavSiteMapProvider" 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" />
     
    CurrentNavSiteMapProviderNoEncode
            <add name="CurrentNavSiteMapProviderNoEncode" description="CMS provider for Current navigation, no encoding of output"
    type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
    Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Current" EncodeOutput="false" />

     
    Custom SiteMapProviders
     
    If none of the SiteMapProviders above give you what you want, you can easily create your own custom SiteMapProvider.
     
    Just add another line to the <Providers> section of the web.config file specifying a unique name and the 'NavigationType' you want to use.
    For example, if I wanted to create a custom provider which used the 'Combined' NavigationType (like the CombinedNavSiteMapProvider above) but I also wanted to enable security trimming and increase the maximum number of nodes to display from the default of 50 to 100, I would insert the following:

    <add name="MyCustomSiteMapProvider" description="A custom SiteMapProvder that enables localization and security trimming"
    type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
    Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Combined" EncodeOutput="false" SecurityTrimmingEnabled="True" DynamicChildLimit="100"/>
     
     
    SPNavigationProvider
    The SPNavigationProvider is another provider which can be used for navigation. This provider is generally used for Windows SharePoint Services or MOSS 2007 implementations without the Publishing Feature enabled.
     
    The main difference between this provider and the other ones above is that it inherits from: Microsoft.SharePoint.Navigation.SPNavigationProvider and you can't specify a 'NavigationType'
     
            <add name="SPNavigationProvider" type="Microsoft.SharePoint.Navigation.SPNavigationProvider, Microsoft.SharePoint,
    Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
     
    Personally, I would stay away from using the SPNavigationProvider within MOSS 2007 unless it was absolutely necessary.
     
     
    Next Post: Implementing your SiteMapProvider within the PortalSiteMapDataSource

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.
    Nick Porter has turned off comments on this page.

    Trackbacks

    Weblogs that reference this entry
    • None