Pregunta

Tengo un proyecto que tiene una página maestra personalizada creada desde Seattle.Master.El único cambio en el archivo .master es la adición de una etiqueta de <SharePoint:ScriptLink> que apunta a una copia de D3.Min.js en nuestro servidor.Nada más en la página principal está personalizada.

El proyecto crea un aspecto compuesto y funciona como se esperaba.El problema es cuando selecciono "Cambiar el look" y elige mi página maestra personalizada en el desplegable Diseño del sitio, la página Master no leerá mi archivo .spcolor incluido en el proyecto.

Tengo un módulo llamado Masterpage con el siguiente código:

<?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>

y un módulo nombrado tema:

<?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>

y el receptor de eventos:

    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();
                }
            }
        }
    }

¿Qué debo hacer para obtener el nuevo tema para recoger el archivo de espacio electrónico incluido?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
scroll top