简体   繁体   English

如何在Sharepoint Online中将主机Web自定义母版页应用于Sharepoint托管的应用程序

[英]How to apply host web custom master page to sharepoint hosted app in sharepoint online

I have created a SharePoint hosted app and deployed it to my Online site. 我创建了一个SharePoint托管应用程序并将其部署到我的在线站点。 But is there a method to apply host web custom master page to SharePoint hosted app. 但是,有没有一种方法可以将宿主Web自定义母版页应用于SharePoint宿主应用。

Please solve this issue. 请解决此问题。

To apply the same master page of host web on your App web please follow the below steps if you are on Publishing site or you have already activated the publishing feature on your site. 要在应用程序网站上应用宿主网站的相同母版页,请在发布网站上或已激活网站上的发布功能的情况下,按照以下步骤操作。 1.Go to site setting-> then click on Master page-> on the Root Web you can check the box "Reset all subsites to inherit this site master page setting" 2. Now if you open your app web you will found an error over there. 1.转到网站设置->然后在根网站上单击母版页->您可以选中“重置所有子网站以继承此网站母版页设置”框。2.现在,如果您打开应用网站,则会发现错误在那边。 For that either you can uninstall your app and redeploy the same or you can use powershell script to fix the issue 为此,您可以卸载应用程序并重新部署该应用程序,也可以使用powershell脚本解决此问题。

param([String]$PortalUrl) param([String] $ PortalUrl)

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue"

if(!$PortalUrl)
{
    $SelectedPortalUrl = Read-Host -Prompt "Please enter the URL of the     portal you want to fix:"
}
else
{
  $SelectedPortalUrl = $PortalUrl
}

Get-SPSite $SelectedPortalUrl | Get-SPWeb -Limit All -filter { $_.Template -  eq "APP" } | Foreach-Object {

$_.MasterUrl = $_.ServerRelativeUrl + "/_catalogs/masterpage/app.master"
$_.CustomMasterUrl = $_.ServerRelativeUrl + "/_catalogs/masterpage/app.master"
$_.Update()

Write-Host "Fixed: " $_.Name -Fore Green
}

Please refer the link this link for more details http://www.casvaniersel.com/2015/01/custom-masterpages-and-sharepoint-hosted-apps/ You can do more modification via using "Chrome Control" Please refer the link below https://msdn.microsoft.com/en-us/library/office/fp179916(v=office.15).aspx 请参考此链接以获取更多详细信息http://www.casvaniersel.com/2015/01/custom-masterpages-and-sharepoint-hosted-apps/您可以使用“ Chrome控制”进行更多修改。请参考链接在https://msdn.microsoft.com/zh-CN/library/office/fp179916(v=office.15).aspx下

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 自定义母版页SharePoint在线 - custom master page SharePoint online 如何在Sharepoint Online上托管的Access Custom Web App上编辑CSS? - How can I edit the CSS on an Access Custom Web App hosted on Sharepoint Online? 如何使用JSOM从SharePoint托管应用程序在主机Web上添加ScriptLink - How to Add a ScriptLink on the Host Web from a SharePoint Hosted App with JSOM 如何在 SharePoint 在线托管 static html 页面 - How to host static html page on SharePoint online 如何go到“Sharepoint APP”页面 sharpoint online - How to go to "APP for Sharepoint" page sharpoint online 如何在线更改Sharepoint中的VersionDiff.aspx母版页? - How to change the master-page of VersionDiff.aspx in sharepoint online? Sharepoint Online:自动部署提供商托管的应用程序 - Sharepoint Online: Deploy Provider hosted app automatically SharePoint Online母版页和网站无法访问 - SharePoint Online Master Page and Site Inaccessible 自定义SharePoint响应母版页 - Custom SharePoint Responsive Master Page 使用JSOM从sharepoint托管应用程序读取Sharepoint在线用户配置文件 - Read Sharepoint online UserProfiles from sharepoint hosted app using JSOM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM