Skip to content

Commit

Permalink
Added the 'spo navigation node add' command solving pnp#521
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz committed Jul 8, 2018
1 parent aa92ac1 commit f0cf146
Show file tree
Hide file tree
Showing 6 changed files with 648 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/manual/docs/about/comparison-powershell.md
Expand Up @@ -159,7 +159,7 @@ Add-PnPJavaScriptLink|SharePointPnPPowerShellOnline|
Add-PnPListFoldersToProvisioningTemplate|SharePointPnPPowerShellOnline|
Add-PnPListItem|SharePointPnPPowerShellOnline|[spo listitem add](../cmd/spo/listitem/listitem-add.md)
Add-PnPMasterPage|SharePointPnPPowerShellOnline|
Add-PnPNavigationNode|SharePointPnPPowerShellOnline|
Add-PnPNavigationNode|SharePointPnPPowerShellOnline|[spo navigation node add](../cmd/spo/navigation/navigation-node-add.md)
Add-PnPOffice365GroupToSite|SharePointPnPPowerShellOnline|
Add-PnPPublishingImageRendition|SharePointPnPPowerShellOnline|
Add-PnPPublishingPage|SharePointPnPPowerShellOnline|
Expand Down
44 changes: 44 additions & 0 deletions docs/manual/docs/cmd/spo/navigation/navigation-node-add.md
@@ -0,0 +1,44 @@
# spo navigation node add

Adds a navigation node to the specified site navigation

## Usage

```sh
spo navigation node add [options]
```

## Options

Option|Description
------|-----------
`--help`|output usage information
`-u, --webUrl <webUrl>`|Absolute URL of the site to which navigation should be modified
`-l, --location <location>`|Navigation type where the node should be added. Available options: `QuickLaunch`, `TopNavigationBar`
`-t, --title <title>`|Navigation node title
`--url <url>`|Navigation node URL
`--isExternal`|Set, if the navigation node points to an external URL
`-o, --output [output]`|Output type. `json|text`. Default `text`
`--verbose`|Runs command with verbose logging
`--debug`|Runs command with debug logging

!!! important
Before using this command, connect to a SharePoint Online site, using the [spo connect](../connect.md) command.

## Remarks

To add a navigation node to a site, you have to first connect to a SharePoint Online site using the [spo connect](../connect.md) command, eg. `spo connect https://contoso.sharepoint.com`.

## Examples

Add a navigation node pointing to a SharePoint page to the top navigation

```sh
spo navigation node add --webUrl https://contoso.sharepoint.com/sites/team-a --location TopNavigationBar --title About --url /sites/team-s/sitepages/about.aspx
```

Add a navigation node pointing to an external page to the quick launch

```sh
spo navigation node add --webUrl https://contoso.sharepoint.com/sites/team-a --location QuickLaunch --title "About us" --url https://contoso.com/about-us --isExternal
```
2 changes: 2 additions & 0 deletions docs/manual/mkdocs.yml
Expand Up @@ -78,6 +78,8 @@ pages:
- listitem get: 'cmd/spo/listitem/listitem-get.md'
- listitem remove: 'cmd/spo/listitem/listitem-remove.md'
- listitem set: 'cmd/spo/listitem/listitem-set.md'
- navigation:
- navigation node aad: 'cmd/spo/navigation/navigation-node-add.md'
- page:
- page add: 'cmd/spo/page/page-add.md'
- page control get: 'cmd/spo/page/page-control-get.md'
Expand Down
1 change: 1 addition & 0 deletions src/o365/spo/commands.ts
Expand Up @@ -60,6 +60,7 @@ export default {
LISTITEM_REMOVE: `${prefix} listitem remove`,
LISTITEM_GET: `${prefix} listitem get`,
LISTITEM_SET: `${prefix} listitem set`,
NAVIGATION_NODE_ADD: `${prefix} navigation node add`,
PAGE_ADD: `${prefix} page add`,
PAGE_CONTROL_GET: `${prefix} page control get`,
PAGE_CONTROL_LIST: `${prefix} page control list`,
Expand Down

0 comments on commit f0cf146

Please sign in to comment.