问题描述
我们的主页中有导航,在现有的SharePoint 2013中使用功能装订
有两个Web应用程序
1)门户网站$
2)MySite
Portal WebApp有10个SiteCollection并有功能装订帮助我们已经在所有网站集和子网站中应用了母版页,工作正常。
现在客户端想要使用SharePoint的全局导航来管理导航,(到现在为止它是inmasterpage硬编码的Url)
我们可以使用 从SharePoint全球导航中获取导航 下面 代码。
函数getGlobalNavigation(webUrl,成功,失败)
{
  var navEndpointUrl = webUrl +" / _ api / navigation / menustate?mapprovidername ='GlobalNavigationSwitchableProvider'";
 的getJSON(navEndpointUrl,成功,失败); 
}
但问题是在mysite中,因为它位于不同的WebApplication,因此在上面的代码中拒绝访问(因此我尝试了以下方式
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/access-sharepoint -data-from-add-ins-using-the-domain-library
我检查了SharePoint 2013有这个js文件/_layouts/15/SP.RequestExecutor .js
现在任何人都可以帮助我解决这个挑战,你需要用b
$ b我想去使用客户端 代码,
但如果不可能,我们也可以使用PowerShell或计时器作业,但在这种情况下,我们需要复制导航,如果客户端有设置也应该小心的观众目标。
任何帮助都表示赞赏
谢谢
We have navigations in our Masterpage with feature stapling in existing SharePoint 2013
Have two WebApplications
1) Portal
2) MySite
Portal WebApp has 10 SiteCollection and with help of feature stapling we have applied master page in all site collections and subsites, which is working fine,
Now the client wants to manage navigation using SharePoint's Global Navigation, (till now it is inmasterpage hardcoded Url)
We are able to get navigation from SharePoint Global navigation using below code.
function getGlobalNavigation(webUrl,success,failure)
{
var navEndpointUrl = webUrl + "/_api/navigation/menustate?mapprovidername='GlobalNavigationSwitchableProvider'";
getJson(navEndpointUrl,success,failure);
}
But the issue is in mysite, as it is at different WebApplication, so getting Access denied in the above code(expected) so I tried below way
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/access-sharepoint-data-from-add-ins-using-the-cross-domain-library
I checked SharePoint 2013 has this js file /_layouts/15/SP.RequestExecutor.js
Now anyone can help me to resolve this challenge,
I want to go using client-side code,
but if it is not possible we can user PowerShell or timer job also, but in that case, we need to copy navigation and if the client has set Audience targetting that also should be taken care.
any help is appreciated
Thanks
推荐答案
全球导航是网站集级别。
The global navigation is on site collection level.
我不太了解你的要求。
这篇关于从不同的webApplication获取全局导航数据/节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!