...

View Full Version : Multiple sitemap files



jleone
02-08-2007, 08:32 PM
Hi guys -

I have multiple sitemap files. If a user chooses one action, I want them to use Web.sitemap for their navigation. If they choose another action, I want them to use Web2.sitemap. The problem is that in the sitemap file, all your nodes must be unique, thus the need for 2 separate files since I have multiple files in both sitemap files.

Example:

Input:
Login --> Default --> Report --> Voucher

Approval:
Login --> Path Choice --> Default --> Report --> Voucher
Login --> Path Choice --> Pending --> Report --> Voucher
Login --> Path Choice --> Checks --> Check Info

What VB code do I use on my page load to use Web2.sitemap under one condition or use Web.sitemap under another?

I also added the following code to my web.config file:

<siteMap defaultProvider="Web" enabled="true">
<providers>
<add
name="Web"
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web.sitemap" />

<add
name="Web2"
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web2.sitemap" />
</providers>
</siteMap>

How do I switch between the two? Thanks.

jleone
02-12-2007, 08:01 PM
Just wanted to let you know I got this working. Missing a very minor piece.

<siteMap defaultProvider="Web" enabled="true">
<providers>
<add name="Web" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap"/>
<add name="Web2" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web2.sitemap"/>
</providers>
</siteMap>

I was missing the "~/" in front of the file name in the siteMapFile.

I could then use Me.SiteMapPath1.SiteMapProvider = "Web" or Me.SiteMapPath1.SiteMapProvider = "Web2".



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum