I have successfully created a custom masterpage for SharePoint 2013 using Visual Studio 2013. Here are the steps I did to create my custom masterpage:Open the 15 hive to directory "15\TEMPLATE\GLOBAL"
- Copy the "seattle.master" file (or the oslo.master file)
- Create a new directory on your C: and paste the file
- Rename the file to anything you want. (i.e. seatle_k.master)
- Open Visual Studio 2013
- Create a new empty project
- Add a new module (2 files are created inside the module automatically.)
- Change the name of the module (i.e. ModuleMP)
- Delete the sample.txt file that was created automatically by adding the module
- Add an existing file to the module. Browse to your new seatle_k.master file and add it.
- Open the elements.xml file in the module.
- Change the <Module ...> by adding "List=116" and Url="_catalogs/masterpage"
- Change the <File ...> by adding Type="GhostableInLibrary"
<?xml version="1.0" encoding="UTF-8"?><Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Url="_catalogs/masterpage" List="116" Name="ModuleMP">
<File Url="ModuleMP/seattle_kcpl.master" Type="GhostableInLibrary" Path="ModuleMP\seattle_k.master"/>
</Module>
</Elements> - Change the name of "Feature1" to something more useful (i.e. K_Feature1)
- Double click on Feature1 (now K_Feature1) and add custom text to the title and description.
- Double check that the project will deploy to the correct site collection URL by checking the "Site URL"
- Build your project
- Deploy your project
- Assuming everything went well your project should be successfully deployed.
(In my case it errored out with "unable to activate feature". then I created the package wsp and deployed with powershell, Add-SPSolution then manually deployed it from Central Admin.)
If this is a publishing site collection, you can change the new masterpage from Site Settings -->Master page and Page layout under look and feel. If this is Team Site Collection then pls follow the below steps. - Open the destination site collection and go to the site settings. Check site features and double check that the solution was added and automatically activated.
- Open SharePoint Designer 2013
- Open the destination site where you deployed your new acme.master file
- In the left-hand vertical navigation in SPD click on the link "Master Pages"
- You should see your new acme.master file in the list
- Right-click on the acme.master file and click link "Set as Default Master Page"
- Ignore and click 'OK' when a pop-up message telling you that there is no associated html file to your masterpage.
- Navigate to your destination site in Internet Explorer to see your new masterpage
No comments:
Post a Comment