I currently have JavaScript that sets the navigation, however it currently sets it to:
"Structural Navigation: Display the current site, the navigation items below the current site, and the current site's siblings"
I cant seem to get it to set to:
"Structural Navigation: Display only the navigation items below the current site"
We are using a SharePoint Online environment and we have built the JavaScript into the page layout.
This is the code I currently have:
$(document).ready(function(){
var scriptBase = _spPageContextInfo.webAbsoluteUrl + "/_layouts/15/";
$.getScript(scriptBase + "sp.runtime.js",function(){
$.getScript(scriptBase + "sp.js",function(){
$.getScript(scriptBase + "sp.publishing.js", modifyNavigation);
});
});
function modifyNavigation(){
var context = SP.ClientContext.get_current();
var currentWeb = context.get_web();
var webNavSettings = new SP.Publishing.Navigation.WebNavigationSettings(context, currentWeb);
var navigation = webNavSettings.get_currentNavigation();
navigation.set_source(1);
webNavSettings.update();
context.executeQueryAsync(function(){
console.log("Navigation set");
},function(sender,args){
alert(args.get_message());
});
}
With this code I end up with the following result:
Is it possible to have the code set the bottom radio button?