Skip Ribbon Commands
Skip to main content

Robin | zevenseas | SharePoint Blog

:

The zevenseas Community > Blogs > Robin | zevenseas | SharePoint Blog > Posts > Why are PortalSiteMapProvider properties defined in the web.config?
June 04
Why are PortalSiteMapProvider properties defined in the web.config?

FYI, this post is a rant on a MOSS specific component called PortalSiteMapProvider.. ;)

I was asked by a the customer where I’m currently working for if it was possible to display more than 50 items on a fly-out in the global navigation. Being the SharePoint guru that I am, I started googling on how to adjust this.. Quickly I found the DynamicChildLimit property on the PortalSiteMapProvider class in the Microsoft.SharePoint.Publishing.Navigation namespace!

But then I quickly found out that I needed to modify the web.config to set this property?! WHY?!?!

Why did the team decide to put this type of parameters in the web.config? Why not create an application page in the Central Administration where you can view and set all those parameters..  I mean.. it’s not just one parameter like the DynamicChildLimit in the web.config. But, out of the box, there are several properties defined which you can set like:

  • NavigationType
  • EncodeOutput
  • IncludePages
  • IncludeHeadings
  • IncludeAuthoredLinks

I can understand that you need to register all the SiteMap providers in the web.config, but I don’t understand why the properties of the providers are set in the web.config. I know it’s a ASP.NET component, but since it’s part of the Microsoft.SharePoint.Publishing.Navigation namespace and they override initialization method I would have figured they would get the parameters from somewhere else..

  if (config["DynamicChildLimit"] != null)
    {
        this.DynamicChildLimit = int.Parse(config["DynamicChildLimit"]);
    }


If someone knows why it’s implemented like this.. please let me know because I would love to know it! :)

 

Technorati Tags: ,

Comments

Pascal Van Vlaenderen

The reason why they didn't implement an application page is probably because they were lazy or out of time.
The reason why they use the web.config is that most of the time sitemaprovider settings are read in the initiation method.
If you look at other sitemapproviders like XMLProviders it's mostly used to define a start point.
I've written custom sitemapproviders a couple of times and used an config attribute to define the start document library. (It were WSS projects that wanted the mimic the publishing feature of MOSS)
System Account on 04/06/2009 01:04
 

 Statistics

 
Views: 2101
Comments: 1
Tags:
Published:1446 Days Ago