I'm creating a custom page layout starting from the Article Page layout, which is associated by default to the master page v4.master. I want now associate this web page with a custom master page of my own. How to do it?
|
All page layouts use CustomMasterUrl of SPWeb (web site), thus you need to create your own implementation of PageLayout class where you redefine the master page accordingly to you requirements. You can follow the link for more details - http://blog.pixelmill.com/821/sharepoint-2010-assign-a-unique-masterpage-to-a-page-layout-in-a-publishing-portal/. Otherwise, you can use 2 or more sites, each for specific Page Layout you are working and change CustomMasterUrl for each of them as required. Thus you'll have 2 site for example, Events and News with custom master pages and page layouts |
|||
|
|
|
In order to change the page layout to custom master page, you will have to go to Site Actions ->Site Settings -> Look and Feel -> Master Page. Select the custom master page that you need to apply and select check box to inherit it to sub sites (if needed). When this is done, all the page layouts(custom or OOTB), will run with the custom master page you have selected. We need to understand here that the master page contains the page layout and not the other way around. So changing the master page will force all page layouts in the site to inherit the master page properties. And as @default has suggested above, there are ways to customize this if you really need. |
|||
|
|
|
In SharePoint designer, Set your master page as custom master page and add\edit MasterPageFile="~masterurl/custom.master" to the page directive as:
|
|||
|
|
|
If somebody doesn't want to create custom master page through the SharePoint Designer, you can follow the steps described in the article - SharePoint: How to create a custom master page - to create a ghostable copy of a built-in master page and get a full access to the Controls-collection due to subclussing. |
|||
|
|
|
This is a 2007 (ans 2010 applicable) article about changing the page layout dynamically on the file on that base of a page layout parameter. To obtain this we have to dig into the code and:
I've now ascertained that achieve this from just SharePoint Designer or the UI interface is not possible :( |
|||
|
|