Can I use more than one homepage on a sharepoint site?

I was asked to change the home page to a completely new design, all other pages will remain the same.

I'm a little green when it comes to sharepoint. I created a master page, however, when I choose to set the default main page or set as the clientโ€™s main page , it changes for the entire site. I would just like to change the homepage.

The only option that I have encountered at the moment looks like Disconnect from the page layout , which would not be ideal, since the rest of the site can be transferred to this new skin

+4
source share
2 answers

Programmatically changing the homepage for this particular page is the only option, as Nigel says.

You can create your own page layout for the home page, and then set the main page to pre-init, as shown below:

public class MyPageLayout:PublishingLayoutPage { protected override void OnPreInit(EventArgs e) { base.OnPreInit(e); this.MasterPageFile = "~/_catalogs/masterpage/mynewmasterpage.master"; } } 
+4
source

SharePoint publishing pages inherit from the Microsoft.SharePoint.Publishing.PublishingLayoutPage class, which programmatically sets the master page on the siteโ€™s custom homepage. There is no way to override this behavior except to make it code itself.

+3
source

All Articles