I've been working with a client and we are nearing the final stages and getting ready to go live with a site. We've done a custom master page and made some changes to allow 2 levels of dynamic flyouts from the global nav. Nothing too exciting.
So the client calls me the other day telling me he can't figure out how to prevent a specific subsite from showing in the Global Nav. His nav is structured like this:
Portal
-SubSite lvl2
-SubSite lvl 3
-SubSite lvl 4
Since we allowed the Global Navigation setting for MaximumDynamicDisplayLevels="2" we'd expect to see all of the SubSites up to lvl 4 in the Global Navigation. Should be easy right? Just go in and turn off allow to show subsites.
Normally that would be true however in this case we were inheriting the Global Navigation from the parent and had the Current Navigation set to only show navigation items below the current site. The client's goal was to show SubSite lvl 4 in the Current Nav but not in Global Nav.
We unchecked to Show Subsites, but SubSite lvl 4 was still there. Why? It turns out that in order to get SubSite lvl 4 to show in the Current Nav the client manually added it as a link. This caused it to roll up to the Global Nav. If you take a look at the default nav control in a publishing master page it looks something like this:
<PublishingNavigation:PortalSiteMapDataSource ID="GlobalNavDataSource"
Runat="server"
SiteMapProvider="CombinedNavSiteMapProvider"
ShowStartingNode="false"
StartFromCurrentNode="true"
StartingNodeOffset="0"
TrimNonCurrentTypes="Heading"
TreatStartingNodeAsCurrent="true" />
The line I've highlighted tells the navigation control to trim out headings from the navigation control, but apparently manually created links are not. To fix the problem we changed the line to look like this:
TrimNonCurrentTypes="Heading, AuthoredLink"
This prevented both headings and manually created links from showing up in the navigation. Unfortuntely, you can only control whether pages or subsites roll up in the navigation using the UI. The navigation definitely allows for much greater control but all the changes must be made through in the master page itself.
Learn something new every day.
JR