How to get a reference of PortalSiteMapProvider object attached to a site that is not in current context

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/21411

  •  06-12-2019
  •  | 
  •  

سؤال

I have a (Publishing)Site Collection which have many sites and subsites. To meet a specific business requirement, I need the navigation settings of a site which is not in current context (It may be another subsite). We can use PortalSiteMapProvider to get the current navigation settings of a site as:

PortalSiteMapProvider provider=PortalSiteMapProvider.CurrentNavSiteMapProvider;

This gives reference to PortalSiteMapProvider of a site in current context. However, I need it for a site which is not in current context. Any ideas?

PortalSiteMapProvider has a property named CurrentWeb which can be set to a SPWeb object. I am not sure if we can use this property.

هل كانت مفيدة؟

المحلول

What i read from your question, correct me if im wrong, is you want the navigation to span across site collections.

The OOB hierarcical navigarion providers cannot so this.

There is an MSDN article that can work as a primer to get started here. You can also find several examples on codeplex and by googling Cross Site Collection Navigation.

The way i solve this, is with a custom hierarcical navigation that we populate with search, combined by adding html meta tags and managed properties that contain order and match pattern for selecting parent sites. It is implemented with minimal footprint by using delegate controls.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top