Table of contents
TOC
Collapse the table of content
Expand the table of content

NavigationExtensions Class

SharePoint Dev Documents|Last Updated: 5/22/2017
|
1 Contributor

This class holds deprecated navigation related methods

This class holds navigation related methods

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Inheritance Hierarchy

System.Object

Syntax

public static class NavigationExtensions

Extension Methods

NameDescription
AddCustomAction(Web, CustomActionEntity)Adds custom action to a web. If the CustomAction exists the item will be updated. Setting CustomActionEntity.Remove == true will delete the CustomAction.
AddCustomAction(Site, CustomActionEntity)Adds custom action to a site collection. If the CustomAction exists the item will be updated. Setting CustomActionEntity.Remove == true will delete the CustomAction.
AddNavigationNode(Web, String, Uri, String, NavigationType, Boolean, Boolean)Add a node to quick launch, top navigation bar or search navigation. The node will be added as the last node in the collection.
CustomActionExists(Web, String)Utility method to check particular custom action already exists on the web
CustomActionExists(Site, String)Utility method to check particular custom action already exists on the web
DeleteAllNavigationNodes(Web, NavigationType)Deletes all Navigation Nodes from a given navigation
DeleteCustomAction(Web, Guid)Removes a custom action
DeleteCustomAction(Site, Guid)Removes a custom action
DeleteNavigationNode(Web, String, String, NavigationType)Deletes a navigation node from the quickLaunch or top navigation bar
GetCustomActions(Web, Expression<Func<UserCustomAction, Object>>[])Returns all custom actions in a web
GetCustomActions(Site, Expression<Func<UserCustomAction, Object>>[])Returns all custom actions in a web
GetEditableNavigationTermSet(Web, ManagedNavigationKind)Returns an editable version of the Global Navigation TermSet for a web site
GetNavigationSettings(Web)Returns the navigation settings for the selected web
IsManagedNavigationEnabled(Web, ManagedNavigationKind)Determines whether the current Web has the managed navigation enabled
LoadSearchNavigation(Web)Loads the search navigation nodes
UpdateNavigationInheritance(Web, Boolean)Updates the navigation inheritance setting
UpdateNavigationSettings(Web, AreaNavigationEntity)Updates navigation settings for the current web

Examples

var editAction = new CustomActionEntity()
{
   Title = "Edit Site Classification",
   Description = "Manage business impact information for site collection or sub sites.",
   Sequence = 1000,
   Group = "SiteActions",
   Location = "Microsoft.SharePoint.StandardMenu",
   Url = EditFormUrl,
   ImageUrl = EditFormImageUrl,
   Rights = new BasePermissions(),
};
editAction.Rights.Set(PermissionKind.ManageWeb);
web.AddCustomAction(editAction);

See also

© 2018 Microsoft