SharePoint 2013: Custom master page does not work when applied to a page

Sara 231 Reputation points
2021-01-22T17:30:48.7+00:00

I have created a custom master page out of Seattle and could successfully publish it to a site and it works on all contents.
However, it does not work when I use the custom master page only for a page when the site is on default Seattle.master. I add this line to the top of the default page:
I just replaced the MasterPageFile from default to the new one. The reset is what I get for creating a page at the site pages.

%@ Assembly Name="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WikiEditPage" MasterPageFile="~masterurl/seattle_2.master" MainContentID="PlaceHolderMain" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Import Namespace="Microsoft.SharePoint.WebPartPages" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

What am I missing?

Microsoft 365 and Office | SharePoint Server | Development
{count} votes

1 answer

Sort by: Most helpful
  1. ZhengyuGuo 10,586 Reputation points Moderator
    2021-01-25T05:27:24.367+00:00

    Hi @Sara ,

    The Master Page should apply to all site pages if applied, so no need to replace the top lines in the page manually.

    Regarding "I noticed the custom master page is not viewable at the subsites. How can I fix it? "

    In Designer Manager -> Edit Master Page, publish the specific master page as major version:

    60036-snipaste-2021-01-25-13-20-23.png

    The Approval Status will change to Approved status:

    60082-snipaste-2021-01-25-13-20-54.png

    Then in sub site settings -> Master Page will have the custom master page viewable:

    60083-snipaste-2021-01-25-13-21-24.png

    Here is a blog about steps to create and deploy custom master page for your reference:

    Steps To Create Custom Master Page In SharePoint 2013 Using Design Manager

    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.