Forum Moderators: open

Message Too Old, No Replies

Multiple Sitemap Files

How I do switch between the two for navigation?

         

jleone

2:47 pm on Feb 9, 2007 (gmt 0)

10+ Year Member



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

3:47 pm on Feb 12, 2007 (gmt 0)

10+ Year Member



I got this to work so thanks.

<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"/>
<add name="Web3" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web3.sitemap"/>
</providers>

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