locked
Custom sitemap provider RRS feed

  • Question

  • Hi there,

    I have to represent my site and subsites in a sitemap and add additional metadata to the nodes of these sites represented in the sitemap (such as page number).

    What would be the best approach to do this? Should I just go off and create a sitemap/node hierarchy by iterating through the site and subsites and thereby adding metadata as I'm building the sitemap? Or is there a better way of doing this by overriding existing functionality in Sharepoint?

    The idea behind all of this is that we have written a component that prints out the entire site collection as pdf files and we have to add additional metadata to the nodes of the hierarchy to be printed.

    Any advice welcome
    Mike
    Thursday, August 14, 2008 6:35 AM

Answers

  • Hey Pikker,
    You are probably going to have to iterate through the site and subsites in order to build out your control structure with the extra meta data information. However, there are different ways to do this. You could loop through the SPWebs of your site, but that might have performance implications because the SPWeb is a little heavy and not cached. My suggestion is to pull in a site map provider and loop through it. I would suggest the PortalSiteMapProvider if you are in MOSS. It quick because it only contains basic information about the site structure and it is cached (which is the real reason it is quick).
    Good luck,
    Greg
    Thursday, August 14, 2008 8:54 PM

All replies

  • Hey Pikker,
    You are probably going to have to iterate through the site and subsites in order to build out your control structure with the extra meta data information. However, there are different ways to do this. You could loop through the SPWebs of your site, but that might have performance implications because the SPWeb is a little heavy and not cached. My suggestion is to pull in a site map provider and loop through it. I would suggest the PortalSiteMapProvider if you are in MOSS. It quick because it only contains basic information about the site structure and it is cached (which is the real reason it is quick).
    Good luck,
    Greg
    Thursday, August 14, 2008 8:54 PM
  • Hi Greg and thanks for the reply.

    It would seem that I have no other option but to build my own custom sitemap because I cannot extent the SiteNavNode objects provided by Sharepoint so I will have to iterate through the site collection.

    Thanks for the pointer on the provider though.

    Cheers
    Mike
    Thursday, August 14, 2008 11:07 PM