I solved this problem by creating a new custom site customization using Visual Studio and SharePoint Site Definition. I added a function that adds my own master page (edited with v4.master) to the gallery of the main page of the site (_catalogs / masterpage):
<Module Name="MasterPageModule" RootWebOnly="FALSE" List="116" Url="_catalogs/masterpage" > <File Url="mymasterpage.master" Path="MasterPageModule\mymasterpage.master" IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary"> <Property Name="ContentTypeId" Value="0x010105"/> </File>
The main thing to get the same main page for all sites is to set MasterPageFile -property in Default.aspx as follows: MasterPageFile = "~ sitecollection / _catalogs / masterpage / mymasterpage.master" - this always refers to the root allocation level.
I think the same thing can be achieved using the FeatureActivated method, but in my case it did not work, I donโt know why.
source share