Answered by:
XML SiteMap issue with relative URL across several site collections

Question
-
Hi guys,
I'm trying to build my own XML sitemap to get a consistent navigation across my different site collections however I'm running into the annoying problem that SharePoint consider the root folder to be the site collection root folder and not the "actual" root folder "/".
So basically when I'm browsing the root site collection on "/" all my URLs in the menus are correct but if I load a site in a different site collection, for instance "/search/", it becomes the new root folder and my menus now targeting "/search/site/" for instance instead of "/site/".
Is there there a way around this? Can the root URL be "hard coded"?
Monday, July 12, 2010 3:53 PM
Answers
-
You need to replace the type in you provider line in web.config with this
System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
- Proposed as answer by TheVirginMatador Thursday, December 1, 2011 11:54 PM
- Marked as answer by Margriet Bruggeman Monday, April 23, 2012 12:21 PM
Thursday, August 18, 2011 4:45 PM
All replies
-
Actually this issue occurs with sub-sites as well, not necessarily site collections. Basically if you're displaying a page that is not at the root level, for instance "http://sharepointsite/subsite/default.aspx" all the links in the sitemap with a target like url="/subsite2/" will actually point to "http://sharepointsite/subsite/subsite2/" when browsing "subsite" (they will work fine from the site collection root site).
My sitemap file looks like the following
<?xml version="1.0" encoding="utf-8" ?><br/> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" ><br/> <siteMapNode title="" description="" url=""><br/> <siteMapNode title="" description="" url=""><br/> <siteMapNode title="Section 1" description="" url="/"><br/> <siteMapNode title="Section 1-1" description="" url="/section1-1/"/><br/> <siteMapNode title="Section 1-2" description="" url="/section1-2/" /><br/> <siteMapNode title="Section 1-3" description="" url="/section1-3/" /><br/> <siteMapNode title="Section 1-4" description="" url="/section1-4/"/><br/> </siteMapNode><br/> <siteMapNode title="Section 2" description="" url="/"><br/> ...<br/> </siteMapNode><br/> ...<br/> </siteMapNode><br/> </siteMapNode><br/> </siteMap>
There must be something I'm missing as this cannot be an expected behavior... Any help would be appreciated.
Thanks!
Thursday, July 15, 2010 7:25 AM -
Hi Thibault, did you end up finding a solution to your problem using an XML Sitemap?
I've written a few jQuery hacks to solve my problem at an absolute last resort, but really don't want to have to use them. I would consider this a bug, because specifying an absolute URL like http://www.google.com.au, and viewing that menu item via the sub site mysite.com/site1 renders the menu link as mysite.com/site1/http://www.google.com
There's no way that is meant to be the intended functionality!
Saturday, July 24, 2010 3:44 AM -
Hi guys,
Just bringing this up again because I've got the same issue over here and haven't be able to find a solution. This does look like a bug to me. Any feedback from MSFT guys monitoring this forum?
Monday, February 7, 2011 11:06 PM -
You need to replace the type in you provider line in web.config with this
System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
- Proposed as answer by TheVirginMatador Thursday, December 1, 2011 11:54 PM
- Marked as answer by Margriet Bruggeman Monday, April 23, 2012 12:21 PM
Thursday, August 18, 2011 4:45 PM -
Exactly what I was looking for .....Thanks a lot !!!Wednesday, August 8, 2012 1:02 PM