사용자 정의 마스터 페이지는 SPFONT 파일을 찾지 못합니다
-
10-12-2019 - |
문제
시애틀에서 생성 된 사용자 정의 마스터 페이지가있는 프로젝트가 있습니다..master 파일의 유일한 변경 사항은 우리 서버에서 d3.min.js의 복사본을 가리키는 <SharePoint:ScriptLink>
태그를 추가하는 것입니다.마스터 페이지의 다른 것은 사용자 정의됩니다.
프로젝트는 작성된 모양을 생성하고 예상대로 작동합니다.이 문제는 "Look을 변경"을 선택하고 사이트 레이아웃 드롭 다운에서 내 사용자 정의 마스터 페이지를 선택하면 마스터 페이지가 프로젝트에 포함 된 내 .spColor 파일을 읽지 않습니다.
다음 코드가있는 MasterPage라는 모듈이 있습니다.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="MasterPage" Url="_catalogs/masterpage">
<File Path="MasterPage\dynetics.master" Url="dynetics.master" Type="GhostableInLibrary" ReplaceContent="TRUE">
<Property Name="ContentType" Value="Master Page" Type="string"></Property>
<Property Name="UIVersion" Value="15" Type="int"></Property>
<Property Name="ContentTypeId" Value="0x010105"></Property>
<Property Name="Title" Value="Dynetics"></Property>
</File>
<File Path="MasterPage\dynetics.preview" Url="dynetics.preview" Type="GhostableInLibrary" ReplaceContent="TRUE">
<Property Name="ContentType" Value="Master Page Preview" Type="string"></Property>
<Property Name="UIVersion" Value="15"></Property>
<Property Name="Title" Value="Dynetics"></Property>
</File>
</Module>
</Elements>
.
및 테마라는 모듈 :
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Theme" Url="_catalogs/theme/15">
<File Path="Theme\dynetics.spcolor" Url="dynetics.spcolor" Type="GhostableInLibrary" ReplaceContent="TRUE" />
<File Path="Theme\dynetics.spfont" Url="dynetics.spfont" Type="GhostableInLibrary" ReplaceContent="TRUE" />
</Module>
</Elements>
.
및 이벤트 수신기 :
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
using (SPSite site = properties.Feature.Parent as SPSite)
{
using (SPWeb web = site.RootWeb)
{
SPList list = web.Lists.TryGetList("Composed Looks");
var relativePath = web.ServerRelativeUrl;
var spcolor = relativePath + "_catalogs/theme/15/dynetics.spcolor";
var spfont = relativePath + "_catalogs/theme/15/dynetics.spfont";
var spimage = relativePath + "_layouts/15/images/geometry.jpg";
if (web != null || web.Exists)
{
foreach (SPListItem composedLook in list.Items)
{
if (composedLook.Title == "Dynetics")
{
composedLook.Delete();
composedLook.Update();
}
}
SPListItem dynetics = list.AddItem();
dynetics["Name"] = "Dynetics";
dynetics["Title"] = "Dynetics";
dynetics["Master Page URL"] = web.MasterUrl;
dynetics["Theme URL"] = spcolor;
dynetics["Image URL"] = spimage;
dynetics["Font Scheme URL"] = spfont;
dynetics["Display Order"] = 1;
dynetics.Update();
web.Update();
}
}
}
}
.
포함 된 .spColor 파일을 선택하기 위해 새로운 테마를 얻으려면 어떻게해야합니까?
해결책
After weeks of trying to debug this issue, a support ticket submitted with Microsoft, and no end in sight, I built a new server and deployed the solution to it.
It worked.
There is no resolution as to why the .spfont file will not work with a custom master page in our current environment.
제휴하지 않습니다 sharepoint.stackexchange