Monday, February 7, 2011

SharePoint 2010 upgraded site Navigation Up or Broken navigation tree issue

After we upgrade SharePoint form 2007 to 2010, we have identified many issues as listed in SharePoint 2010 upgrade real world exception handling blog. I may take some time to list in details on some of the issues and workaround. One of the mysterious is lots of sites have “Broken navigation tree” or “Empty Navigate Up control”. We have been working with Microsoft for the last seven months and we have finally found a good solution to fix it. Here are some tips that could help to understand the issues, identify the sites that have such issues, and the way to fix it.

1. Summary of the issue

SharePoint 2010 provides a very nice feature that you could click the navigation button to identify the location of the site and you could navigate the hierarchy. However, many sites migrated from 2007 navigation up is empty. You could see the following screenshot that “Navigation Up” is empty for the site.




2. What migrated 2007 site pages that may have such issue

We found navigate up issue for all the publishing pages (welcome page with webpart zones) created from collaboration portal template in 2007. Collaboration portal has been deprecated in 2010 and 2010 team sites with publishing feature enabled don’t have welcome page with webpart zones template option while creating publishing page. You could verify the site that will have navigate up issue from the page under ../Pages/Forms/AllItems.aspx/Default.aspx. If the site is created from collaboration portal and the default page is “Welcome page with Web Part zones”, the site will have “Navaigation Up” issue.

See the screenshot the Page Layout is “Welcome page with Web Part zones” for the default page. Please note this is the publishing pages under Pages folder NOT the SitePages under SItePages.




The possible pages that may have such issue are:
• DefaultLayout.aspx
• ReportCenterLayout.aspx
• TabViewPageLayout.aspx
• NewsHomeLayout.aspx

3. Root cause of the issues

The reason that the navigate up control is not displaying the correct navigation hierarchy on the pages is the Master Page and the Page Layout page associated to the page contain a PlaceHolderTitleBreadcrumb.

In the master page the PlaceHolderTitelBreadcrumb is defined as follows. Notice the .Net control that is added in the place holder (ListSiteMapPath). This is the control responsible for rendering the navigation hierarchy in Navigate Up.

<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
     <SharePoint:ListSiteMapPath runat="server"
     SiteMapProviders="SPSiteMapProvider,SPContentMapProvider" RenderCurrentNodeAsLink="false"
     PathSeparator=""
     CssClass="s4-breadcrumb"
     NodeStyle-CssClass="s4-breadcrumbNode"
     …
</asp:ContentPlaceHolder>
</SharePoint:PopoutMenu>


Please note 2010 site page has changed to version 4 that is different from 2007 v3. When the version 3 site page layouts in 2007 are used they define the PlaceHolderTitleBreadcrumb as follows.

<asp:Content ContentPlaceHolderId="PlaceHolderTitleBreadcrum" runat="server" />

The content place holders in the layouts pages override the content place holders in the master page. So the above line in the layout page removes the navigation control hierarchy from the page.

This issue will occur if you use the following some other layouts as I listed in last session.


4. Procedure to reproduce the issue we submitted to Microsoft

The issues: Navigation up missing for sites created from 2007 collaboration portal template with publishing pages migrated from 2007 to 2010
Impacts: We have hundreds of sites uses are not able to use navigation on the site

Steps to reproduce the issues:
• Create sites using 2007 collaboration portal template
• Activate all publish features
• Add some webparts on the default home page – welcome page
• Add some sub-sites to test navigations
• Migrate the site from 2007 to 2010
• Verify Navigation up missing for the welcome page



5. Produces to fix this issue


To correct the issue with Navigate Up issue is very straight forward after we understand version 3 site page layouts in 2007 overwrite the navigation in 2010. This seems to be a design flaw for 2010. Here are the steps to fix the issue on default.aspx.

• Open the page layout in SharePoint Designer and remove the following line.

<asp:Content ContentPlaceHolderId="PlaceHolderTitleBreadcrum" runat="server" />

• Save the page layout, check it in, and then publish it. This will correct the issue for every page that uses the layout.


The TabViewPageLayout.aspx is the layout used for the Site Directory. This is the layout for category.aspx which is the default page for the Sites site in the collaboration portal. This layout has the PlaceHolderTitleBreadcrumb content place holder also but with the following tag.



This can also be removed and the Site Directory navigate up control will display the same as the rest of SharePoint 2010.



6. How to identify all the sites that might have this issues



At this time, you have understand the issue and the solution. However, you may not be able to identify the list of the site and pages that have the issue. You could use powershell script to identify pages on those sites that are having issues. Here is the one script you could run against the farm to list pages and sites.

-----------------------------------------------------------------------------------
$data = @()
$webApps = Get-SPWebApplication

foreach($webApp in $webApps)
{
$sites = $webApp.Sites

foreach($site in $sites)
{

foreach($web in $site.AllWebs)
{

foreach($list in $web.Lists)
{

if($list.Title -eq "Pages")
{

foreach($item in $list.Items)
{
[string]$pageLayout = $item["PublishingPageLayout"]
$temp = New-Object PSObject
$temp | Add-Member -MemberType NoteProperty -Name "URL" -value $web.Url
$temp | Add-Member -MemberType NoteProperty -Name "Library" -Value $list.Title
$temp | Add-Member -MemberType NoteProperty -Name "Page" -Value $item.Name
$temp | Add-Member -MemberType NoteProperty -Name "PageLayout" -Value $pageLayout

if($pageLayout.ToLower().Contains("defaultlayout.aspx") -or $pageLayout.ToLower().Contains("reportcenterlayout.aspx") -or $pageLayout.ToLower().Contains("tabviewpagelayout.aspx") -or $pageLayout.ToLower().Contains("newshomelayout.aspx"))
{
$temp | Add-Member -MemberType NoteProperty -Name "PageLayoutNeedsChange" -value $true

}
else
{
$temp | Add-Member -MemberType NoteProperty -Name "PageLayoutNeedsChange" -value $false
}
$data += $temp
}
}
}
$web.Dispose()
}
$site.Dispose()
}
}
$data | fl
-------------------------------------------------------------

If you have any feedback, please let me know.

Good luck on your upgrade!

10 comments:

  1. This looks like a very complete answer but there seems to me missing some information.

    In section 5 it says "...To remove the following line". but there is nothing under it. What line should I remove?

    ReplyDelete
  2. You should remove following line:

    asp:Content ContentPlaceHolderId="PlaceHolderTitleBreadcrumb" runat="server"

    ReplyDelete
  3. Thanks for the feedback, I added the line you need to remove in the blog to fix the issue.

    ReplyDelete
  4. Thanks a lot .. much much appreciate this :) excellent resolution

    ReplyDelete
  5. I'd like to add if the file is not in a publishing infrastructure environment, the default.aspx page must be opened in SP Designer in advanced mode for this to work.

    Thanks for the tip!

    ReplyDelete
  6. I am behind the curve here but the solution is great and worked fine. Also had some good help from the comment section too. Thanks Harry :-)

    ReplyDelete
  7. I need to to this to hundreds of sites within 1 site collection. Is there a powershell script that can update the default.aspx page of each site with the site collection?

    ReplyDelete
  8. Does anyone know why this issue would be occurring after using Metalogix to move 2007 sites around on a 2007 site? The issue is very much the same for us.

    ReplyDelete
  9. I am migrating site from 2007 to 2010 and then 2010 to 2013 and facing this issue on client side. Can you please help me.

    ReplyDelete