3

In a SharePoint 2013 publishing site, I set up global navigation to show structural navigation.

Basically, I have this following site hierarchy:

  • root
    • subsite
      • sub-subsite
      • sub-subsite2
    • subsite2

This is the physical structure, but I want to set up this logical user navigation:

  • root
    • subsite
      • sub-subsite
      • Folder
        • sub-subsite2
    • Folder
      • subsite2

To achieve this result, I tweak the navigation of both subsite and root to create a navigation folder.

However, this is not working as expected. The folder in the root site is shown in the navigation, but the folder within the subsite does not appears.

How can I set up my navigation to reach my goal ?

Actually, the application I'm working on uses a custom master page. If I have to update it, it can be done.

By now, the navigation menu is defined using:

<PortalSiteMapDataSource
    ID="topSiteMap"
    runat="server"
    EnableViewState="false"
    SiteMapProvider="GlobalNavigationSwitchableProvider"
    StartFromCurrentNode="true"
    StartingNodeOffset="0"
    ShowStartingNode="false"
    TrimNonCurrentTypes="Heading" />
<AspMenu
    ID="TopNavigationMenu"
    runat="server"
    EnableViewState="false"
    DataSourceID="topSiteMap"
    AccessKey="&lt;%$Resources:wss,navigation_accesskey%&gt;"
    UseSimpleRendering="true"
    UseSeparateCSS="false"
    Orientation="Horizontal"
    StaticDisplayLevels="1"
    AdjustForShowStartingNode="false"
    MaximumDynamicDisplayLevels="2"
    SkipLinkText=""></AspMenu>

FYI, here is the actual result:

subsite

subsite 2

And here is the navigation settings of the root site:

root nav settings

Finally, the navigation settings of the subsite:

subsite nav

1

Actually, the solution was quite simple. I had to remove the attribute TrimNonCurrentTypes from my datasource:

<PortalSiteMapDataSource
    ID="topSiteMap"
    runat="server"
    EnableViewState="false"
    SiteMapProvider="GlobalNavigationSwitchableProvider"
    StartFromCurrentNode="true"
    StartingNodeOffset="0"
    ShowStartingNode="false"
    />

And it solved the issue.

Don't know why this attribute is set by default on OOB master pages.

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.