Question

I have two custom masterpages, one for site, and one for the system pages. Both of these masterpages use the same CSS file, and they both also reference a different CSS file than the other.

SiteMasterPage: CSSFileA CSSFileB

SystemMasterPage: CSSFileC CSSFileB

If I have both of these masterpages being defined in the Site Settings ---> Masterpages, no matter what I do, SharePoint decides to use the SystemMasterPage for both the Site and System. To prove this, while on the root (http://sitecollection/SitePages/default.aspx), I view the source and I can see clear as day that it is using both CSS files from the SystemMasterPage declaration (CSSFileC & B), and NOT the SiteMasterPage (CSSFileA & B).

Can anybody explain this?

This is another example: SitePages uses System Master Page

Thanks in advance.

Was it helpful?

Solution

If you are using Site Pages, you do not have the publishing infrastructure enabled, or the site level publishing features enabled. This created Pages in the Pages library, and these use the site master page. "site pages" are foundation based pages that only use the system master page.

You can enable the publishing infrastructure assuming you are running SharePoint Server, even on a team site. This will give you publishing features for "pages", but not "site pages".

OTHER TIPS

The Site Master Page set from the settings page affects (or limited to) publishing pages stored in Pages Library when the Publishing infrastructure is enabled or publishing site template is used.

For pages stored in SitePages library, you may want to change the page declaration to use dynamic token as shown below

<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WikiEditPage" MasterPageFile="~masterurl/custom.master" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document"   %>

The token "~masterurl/custom.master" is replaced at run time by the value in the CustomMasterUrl property of the SPWeb which you are already setting from the settings page.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top