Clase PortalNavigation
Representa la navegación de páginas del portal y otros objetos de navegación del portal.
Jerarquía de la herencia
System.Object
Microsoft.SharePoint.Publishing.Navigation.PortalNavigation
Espacio de nombres: Microsoft.SharePoint.Publishing.Navigation
Ensamblado: Microsoft.SharePoint.Publishing (en Microsoft.SharePoint.Publishing.dll)
Sintaxis
'Declaración
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class PortalNavigation
'Uso
Dim instance As PortalNavigation
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class PortalNavigation
Comentarios
En el ejemplo de código siguiente se configura el portal de navegación para un sitio especificado.
Ejemplos
/ Assemblies that need to be referenced in this sample:
// Microsoft.SharePoint.dll
// Microsoft.SharePoint.Publishing.dll
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Publishing;
using Microsoft.SharePoint.Publishing.Navigation;
namespace Microsoft.SDK.SharePointServer.Samples
{
public class Program
{
public static void Main(string[] args)
{
// Configure the portal navigation settings for a particular site.
using (SPSite siteCollection = new SPSite("http://yourServer"))
{
using (SPWeb site = siteCollection.OpenWeb("/site1"))
{
PublishingWeb pubSite = PublishingWeb.GetPublishingWeb(site);
PortalNavigation portalNav = pubSite.Navigation;
// Show pages in the current navigation (on the left for LTR languages using SharePoint's
// default Master Pages).
portalNav.CurrentIncludePages = true;
// Increase the number of dynamic children in the current navigation to 50.
portalNav.CurrentDynamicChildLimit = 50;
// Disable global navigation inheritance, establishing the site as the new global navigation root
// for any sites below it; also disable the sibling display behavior for the current navigation.
portalNav.InheritGlobal = false;
portalNav.ShowSiblings = false;
// Enable automatic sorting for all of the site's navigation items.
portalNav.OrderingMethod = OrderingMethod.Automatic;
using (SPWeb siteToHide = siteCollection.OpenWeb("/site1/site2"))
{
// Hide a specific sub-site from display in global navigation.
portalNav.ExcludeFromNavigation(true, siteToHide.ID);
// Hide a specific sub-site from display in current navigation.
portalNav.ExcludeFromNavigation(false, siteToHide.ID);
}
// Save the changes to the store.
pubSite.Update();
}
}
}
}
}
Seguridad para subprocesos
Los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para subprocesos. No se garantiza que los miembros de instancias sean seguros para los subprocesos.
Vea también
Referencia
Espacio de nombres Microsoft.SharePoint.Publishing.Navigation