Blog Home 
Scott Yokiel MOSS 2007 & .NET blog (and some bad spelling) - Replace sharepoint left nav with a tree view control

RSS 2.0 Atom 1.0 CDF  
 
Sign In
 
 Tuesday, September 16, 2008

In Master Page Replace everything in <asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"> with

      <ASP:TreeView ID="CurrentNav" runat="server" datasourceID="SiteMapDS"
        AccessKey="3" CssClass="leftNav" ExpandDepth="1"
        SkipLinkText="<%$Resources:cms,masterpages_skiplinktext%>">
      </ASP:TreeView>
      <PublishingNavigation:PortalSiteMapDataSource ID="SiteMapDS" Runat="server"
       SiteMapProvider="CurrentNavSiteMapProviderNoEncode" EnableViewState="true"
       StartFromCurrentNode="true" StartingNodeOffset="0" ShowStartingNode="false"
       TrimNonCurrentTypes="Heading"/>

We striped out some of the item level tags and chaged from a sharepoint:aspMenu to a ASP:Treeview.  Then we need to tweak the web.config. Add 'RequireUniqueKeysForNodes="true"' to CurrentNavSiteMapProviderNoEncode to make it look like this.

<add name="CurrentNavSiteMapProviderNoEncode"
   description="CMS provider for Current navigation, no encoding of output"
   type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c"
   NavigationType="Current" EncodeOutput="false" RequireUniqueKeysForNodes="true" />

 

reset ISS and roll

9/16/2008 10:41:47 AM (Central Standard Time, UTC-06:00)  #    Comments [0]    |  Trackback
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Copyright © 2008 RBA Consulting.