Sp-dev-docs: Unable to add Navigation Node to TopNavigationBar (hubsite navigation)

Created on 12 Sep 2018  路  9Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Adding a navigation node via GUI or PNP should add the link to the navigation.

Observed Behavior

Adding a navigation node via GUI or PNP PowerShell doesn't error out, the node seems to be added (checking via Powershell) but it is not visible

Steps to Reproduce

Sharepoint web interface/GUI: Click edit on the hub site nav and add try to add a link. It will save, but the link doesn't appear on the navigation bar.

Powershell: Add-PnPNavigationNode -Location TopNavigationBar -Title test -Url /sit
es/test

  • adds the navigation successfully as per PowerShell. The link doesn't show up on the web interface/GUI
  • Tried to add a child link under a parent and same experience
  • Tried adding a full link instead of a relative link, still same issue

Submission Guidelines

Thanks for your contribution! Sharing is caring.

other bug-suspected

Most helpful comment

You can edit hub navigation links on classic site settings page. Just navigate to Site information and View all site settings or type in /_layouts/15/settings.aspx after your site Url.
There you can edit site's top navigation, which affects also to hub navigation.
image

I hope this is just a temporary workaround.

Thanks to Aki Stenman and Finnish SharePoint User Group

All 9 comments

I am experiencing the exact same problem. I've not tried PowerShell but the GUI isn't working for me, at least on one of our customer sites.

Looking at the XHR request to the SaveMenuState endpoint, the nodes array includes a number of objects and they all have a 'Key' property except for the one I am trying to create.

Response

Not sure if this is related?

I just checked 5 other tenants and this issue seems to be replicated across all tenants on multiple site collection. Is there a workaround to add navigation nodes? If not, when can we expect a fix deployed. Sorry a bit new here, so not sure what the process is.

And if you want any further info/troubleshooting, please let me know and I will capture it.

Thanks.

You can edit hub navigation links on classic site settings page. Just navigate to Site information and View all site settings or type in /_layouts/15/settings.aspx after your site Url.
There you can edit site's top navigation, which affects also to hub navigation.
image

I hope this is just a temporary workaround.

Thanks to Aki Stenman and Finnish SharePoint User Group

@mpaukkon Thank you for the workaround. The link does get added in the settings page as you have mentioned, however when we go to modern page view, the link is not visible.

I just learned that, once you add the navigation node via mpaukkon's method, you can force replication on the hub nav by editting the navigation in the modern view and try to move the node up or down. It doesnt really move the node, but it forces it to become visibile. Hope this helps other folks with the same issue

Should this issue be closed? I have just found the same conclusions as faisal-ijaz where you need to edit the nav menu and then close it to refresh. If we are programming the menu, this is a good work around however in my mind, this should refresh automatically

For me it is still a problem when you add navigation items by script. If this affects many pages there is no one clicking on edit to make the new items appear. How can you refresh the navigation with powershell to make that happen?

Maybe there you can call the udpate routing that is triggered, when you click on "edit"?

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

acksoft picture acksoft  路  3Comments

christianbueschi picture christianbueschi  路  3Comments

ken-harris picture ken-harris  路  3Comments

thechriskent picture thechriskent  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments