How to Create a Custom SharePoint 2010 Master Page

Links
Codeplex starter master pages
MSDN branding Article

Using SharePoint Designer

  1. Open SharePoint Designer (SPD) and connect to the root level of your site’s site collection.
  2. In SPD, open the "_catalogs" folder, then open the "masterpage" folder.
  3. In SPD, right-click on the master page you want to duplicate and select "Copy," then paste it back into the same folder.
  4. Rename the new file something project-specific.
  5. Publish and approve the new master page.
  6. In your browser, navigate to your site’s Site Settings page.  Under the "Look-and-Feel" column click "Master page."
  7. Select your new master page as the site master page and save

Information from above came from here

To make master page and deploy via Visual Studio

Create an Empty SharePoint project, add a module

Sample.txt file can be renamed to sample.master

Open up SharePoint Designer and copy and paste v4.master code to module

Make sure the module is added to a feature in your project that is scoped at the site (= site collection) level

Add some code that will apply the sample.master master page when the feature gets activated and it will apply the v4.master when the feature gets deactivated. as follows:

image

Now if you activate the feature the code in the feature receiver will run and will apply sample.master to the site. As you can see we change both the MasterUrl and the CustomMasterUrl. The MasterUrl is used on all pages that are not publishing pages. This means it is used on the pages in the sitepages library and on the pages in the _layouts directory like the settings page for instance. The CustomMasterUrl is only used on pages that are stored in the Pages library. This library is created when the SharePoint Server Publishing Infrastructure features is activated on the site collection and the SharePoint Server Publishing feature is activated on the site.

Information from above came from here

Advertisements