Edit Layout Pages to add Snippets from Snippet Gallery in SharePoint 2013
How to Edit Page Layout
In SharePoint 2013 for every Layout page two files – .aspx and html are Created by default.For making Changes to the Custom Layout, you need to download the html file of the layout page and make Changes to it. The modified html file is then saved back to the MasterPage Page gallery and the corresponding .aspx file gets updated automatically.
In our case below are two files created.
To work with these files you can either navigate to the Master Page gallery of your site or you can download them by Mapping the MasterPage Gallery as a Netwrok drive .See the Step-by-Step tutorial on How to Map MasterPage Gallery as a Netwrok drive.
Once your download a copy of “Custom Page Layout.html” file( using ‘Download a Copy’ option in callup menu \ecb menu) you can simply add\remove the desired code snippets from the file and save it.
Lets look at an example of adding a SharePoint field Control copied from the new Snippet Gallery feature into our Custom Layout page.
To Open the Layout page in the Snippet Gallery click on the Custom page layout in Design Manager in “Edit Page Layout’s” list.See the screen below
When you click on the layout you will be taken to the Preview page of your layout. Click on “Snippets” top right corner.See below
Next in the “Page Field” select “Article Date” field.
Once you select the Field, a preview of the Field and the corresponding HTML Code gets displayed. Copy the HMTL code for this field to clipboard and add it to our Layout Page’s HTML. Open the Layout Page in an editor of your choice and paste the Copied Code in it.
See below
Save the Page and upload it back to MasterPage Gallery.
Once the Layout is Updated you must Publish it again as a Major Version before using it.
Next Create a Page using the new Custom Layout (See Steps Here) or edit the existing Layout for a page.
Finally, Edit the page and View the Changes.Notice the “Article Date” field added to the layout of the page in the screen below.
1 comments:
Great article, let me introduce you other way to add custom master pages to the SharePoint.
Bind Tuning have an online tool where you can fully customize a theme for SharePoint that includes several new masterpages, and a lot of features that are not available in the default themes.
Take a look at www.bindtuning.com and try it for free.
Post a Comment