1

I am building the navigation for a hub site in SharePoint Online using PowerShell and I want some of my links to be headers only (not URL).

I am using the following Powershell commands to create my navigation nodes:

To create a menu item with a hyperlink I use: Add-PnPNavigationNode -Title "Menu 1" -Url "" -Location TopNavigationBar

I am trying to create one without a link (so just a header) and I tried:

Add-PnPNavigationNode -Title "Menu 2" -Url "" -Location TopNavigationBar -Parent 123 # empty Url paramter

Add-PnPNavigationNode -Title "Menu 2" -Location TopNavigationBar -Parent 123 # no Url parameter

Both options are creating a menu item with a link to the hub home page.

Note that if I edit the links through the UI I can change it from URL to Header.

Any idea how I can create a Header item in the top navigation?

Thanks

  • I've did multiple tries and the cmdlt seems buggy as hell. Seems to be some problems reported on github related to it. github.com/SharePoint/PnP-PowerShell/… – Christoffer Sep 27 at 14:58
  • Yeah, tried all the option available. it seems previously they have option to add header but currently every Navigation node need to be added as link. may be you need to raise as userVoice or github forum – vinit kumar Sep 27 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.