locked
Custom Master Page for Page Layout? RRS feed

  • Question

  • I would like to develop a third custom master page (besides default and custom master pages). Is it possible? I have a requirement to specify custom master page to a page layout. Is that possible?

    Default and custom are already taken so how can I specify custom master page to page layout? Am I going in the correct direction?

    I do not want to go into site settings > master page and specify the custom master page to all the subsites since it is going to be only for one subsite.

    Thanks!


    • Edited by diffident Tuesday, August 23, 2016 9:15 PM
    Tuesday, August 23, 2016 9:09 PM

Answers

  • You can create as many master pages as you want.  The trick is that there are only two replaceable parameters for use with masterpages.  So if you want to use a third master page you will need to specify the full URL to the where the master page is stored in the @page declaration instead of using default.master or custom.master.  Also, be sure to store the master page in the content database if it will be used with a page layout stored in the content database and in _Layouts if used with a custom application page.

    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    • Marked as answer by diffident Wednesday, August 24, 2016 3:06 PM
    Tuesday, August 23, 2016 10:01 PM

All replies

  • You can create as many master pages as you want.  The trick is that there are only two replaceable parameters for use with masterpages.  So if you want to use a third master page you will need to specify the full URL to the where the master page is stored in the @page declaration instead of using default.master or custom.master.  Also, be sure to store the master page in the content database if it will be used with a page layout stored in the content database and in _Layouts if used with a custom application page.

    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    • Marked as answer by diffident Wednesday, August 24, 2016 3:06 PM
    Tuesday, August 23, 2016 10:01 PM
  • Hi,

    You have to develop custom page layout and specify your custom master page for that page

    https://nikpatel.net/2009/11/30/moss-2007-specifying-custom-master-page-for-the-specific-page-layouts/


    Please remember to click Mark as Answer on the answer if it helps you

    Tuesday, August 23, 2016 10:08 PM
  • You can create as many master pages as you want.  The trick is that there are only two replaceable parameters for use with masterpages.  So if you want to use a third master page you will need to specify the full URL to the where the master page is stored in the @page declaration instead of using default.master or custom.master.  Also, be sure to store the master page in the content database if it will be used with a page layout stored in the content database and in _Layouts if used with a custom application page.

    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    Thanks Paul!

    Can you please explain how I can store the master page in content database? I have used SharePoint Designer to copy an existing master page and customized it. Isn't that stored in content database?

    Tuesday, August 23, 2016 10:42 PM
  • master pages uploaded to the master page gallery in Site Settings are stored in the content database. Master Pages deployed to _Layouts using a Feature aren't in the document library.  so yes, using SPD to copy an existing master will leave it in the content database.

    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    Tuesday, August 23, 2016 10:48 PM