Get Hidden Subsites in current navigation

Hello everybody,

I'm using PortalSiteMapProvider to create my own custom navigation, and my own custom navigation control (without site width limitation, i.e, my navigation tree shows subsites to the nth level).

       _portalSiteMapProvider =

newMicrosoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider();

            _portalSiteMapProvider.IncludePages = Microsoft.SharePoint.Publishing.Navigation.

PortalSiteMapProvider.IncludeOption.PerWeb;

            _portalSiteMapProvider.IncludeSubSites = Microsoft.SharePoint.Publishing.Navigation.

PortalSiteMapProvider.IncludeOption.Always;

            _portalSiteMapProvider.NavigationType = Microsoft.SharePoint.Publishing.Navigation.

PortalNavigationType.Current;

            _portalSiteMapProvider.IncludeAuthoredLinks = true;


            _portalSiteMapProvider.IncludeHeadings = true;


later I'm recursing using

foreach

(PortalSiteMapNodesubSiteMapNode inportalSiteMapNode.ChildNodes)

...

and get all the nodes for my custom top menu.

Thing is, if I use Microsoft navigation page to hide a subsite (i.e, go to /_layouts/AreaNavigationSettings.aspx, choose a subsite and hide it), I can't see it anymore using my loop.

I want to be able to display hidden subsite in my tree.

Doesn anyone has an idea how to do it?

also I want to be able to perform hide / show subsite in my custom navigation tree. tried using publishingWeb.IncludeInCurrentNavigation - but when I use false - it causes the subsite to disappear from my custom menu - but also from my custom navigation tree.

Thanks,

Barak













July 29th, 2015 3:10am

Unfortunately I do not believe you will be able to use PortalSiteMapProvideras this respects audience targeting as well as the general site map that SP maintains. This includes your hidden webs.

You will likely need to use or build a custom control that can map your entire site tree on its own. or build a timer job that can crawl your site every so often and record a site map in memory for your custom nav provider to reference.

Free Windows Admin Tool Kit Click here and download it now
July 30th, 2015 1:41am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics