0

I'm coding a custom WebPart in SP 2013 called LeftNavigation, as the name implies, the idea is that this webpart shows the SP left navigation so our users can add it on specific Page Layouts.

The problem I'm having is that this WP is not showing the same navigation items as the system master page. Whenever I configurate the site to use managed metadata navigation or structured navigation, this WP still shows what it seems to be a list of lists within the site. I'm using the same map provider from the default system master page and still no luck:

<asp:SiteMapDataSource
   SiteMapProvider="SPNavigationProvider"
   ShowStartingNode="False"
   id="topSiteMap"
   StartingNodeUrl="sid:1025"
   runat="server"
/>

Any thoughts?

0

asp:SiteMapDataSource only displays the items configured in the Navigation settings of the site.

The control(s) that displays managed metadata navigation among other things are separate SharePoint ASP.NET controls.

In order to show "everything" the OOTB left navigation shows you'll have to include the placeholders as well and those distinct placeholders cannot leave the masterpage or else it starts throwing errors.

I strongly oppose from creating custom left navigation controls/web parts as you cannot move the entire expected functionality to them.

If anything, you should leave the left navigation as is in the masterpage and control its appearance using CSS. Overwrite the default CSS with #s4-leftpanel { display:none; } property and make a CEWP containing <style>#s4-leftpanel { display: block; }</style>, export it and import it into the Web part gallery and tell your users to insert that webpart anywhere on the page to show the left navigation.

1
  • That's not really an option because we need to have a webpart zone on the left column.
    – MadKian88
    Apr 22 '14 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.