SOLVED

Edit SharePoint Quicklaunch with /_api/navigation/SaveMenuState

Copper Contributor
Hey community,

I have to change the quick launch node titles of several hundred site collections in depdency to the culture info of users browse, i.e. Contracts in English and Verträge in German.
I found the hint in internet, that this might be possible with /_api/navigation/SaveMenuState

I would like to write a PowerShell function to change the quick launch.

Does anybody experience with this api or know where I can found a documentation?

Kind regards
Chris

I
1 Reply
best response confirmed by Chris10250 (Copper Contributor)
Solution

After several days of R&D I found a way to manage the quicklaunch in a multi-language environment with PowerShell. You can find an example script attached. 

 

The example script has this funcitonality

  • "get-QuickLaunch"
  • The complete quicklaunch structure is requested for english and german language settings and returned as an array.

  •  
  • "add-SingleNode"
  • A new main navigation element is set with language settings in german and english

  •  
  • "new-Quicklaunch"
  • Current quicklaunch is completly replaced in 'two' steps with a new quicklaunch in german and english. The Nodes are the same as before, but titles are extended with current time. 
    It would be possible to add each node separatly, but in our use case, it wouldn't be nice, when the user sees the growing navigation tree. To avoid this, I have implemented a three step approach. First create the tree with all nodes and my node identifiers. Second and third step update the language versions. 

The only preconditions to run the script is that you have 

  • App-Security authentification configured
  • Apply your App-Security informations at the beginning of the Script (lines 3-6)
  • Set the Site URL in line 8

     

  • App has SiteCollection admin rights to access the SharePoint site

 

It would be nice, if you could send me feedback to my example.

Regards

Christian

1 best response

Accepted Solutions
best response confirmed by Chris10250 (Copper Contributor)
Solution

After several days of R&D I found a way to manage the quicklaunch in a multi-language environment with PowerShell. You can find an example script attached. 

 

The example script has this funcitonality

  • "get-QuickLaunch"
  • The complete quicklaunch structure is requested for english and german language settings and returned as an array.

  •  
  • "add-SingleNode"
  • A new main navigation element is set with language settings in german and english

  •  
  • "new-Quicklaunch"
  • Current quicklaunch is completly replaced in 'two' steps with a new quicklaunch in german and english. The Nodes are the same as before, but titles are extended with current time. 
    It would be possible to add each node separatly, but in our use case, it wouldn't be nice, when the user sees the growing navigation tree. To avoid this, I have implemented a three step approach. First create the tree with all nodes and my node identifiers. Second and third step update the language versions. 

The only preconditions to run the script is that you have 

  • App-Security authentification configured
  • Apply your App-Security informations at the beginning of the Script (lines 3-6)
  • Set the Site URL in line 8

     

  • App has SiteCollection admin rights to access the SharePoint site

 

It would be nice, if you could send me feedback to my example.

Regards

Christian

View solution in original post