Simple solution could be creating new Page Layouts, referring another master page.
Here are the simpler steps to achieve this.
- Create a new Page Layout (either by using SharePoint designer or manually creating new aspx page)
- Specify custom.master as the MasterPageFile attribute for the page directive.
MasterPageFile="~masterurl/custom.master"
- On PreInit event, change the MasterPageFile url to required master page.
void Page_PreInit(Object sender, EventArgs e)
{
this.MasterPageFile = "~SiteCollection/_catalogs/masterpage/myCustom.master";
}
</script>
- This may lead to error with “Code-blocks are not allowed in this file.”
PageParserPaths is a special node in web application's web.config file. By Default this node
<pageparserpaths>
<pageparserpath virtualpath="sites/mysite/_catalog/masterpage/*" compilationmode="Always" allowserversidescript="true" includesubfolders="true">
</pageparserpaths>