Creating a Custom Page Layout in SharePoint 2013
Creating a Custom Page Layout in SharePoint 2013
In my last article, I documented how to create a Master Page in SharePoint 2013. Master Pages define the global chrome elements of your web site. This article explains how to create custom page layouts in SharePoint 2013. For more information on the SharePoint 2013 page model, see this Microsoft article.
Planning Out Your Page Layout
For this example, we’re going to recreate a chunk of a page on our web site (www.navantis.com):

In our previous article, we created Master Page that defined the header, footer and global style sheets for this page. Now we’re going to create a page layout that follows this basic format. The content will be dynamic so that you could create as many pages as you like based on this layout.
In our page layout, we’re going to define the following areas as “field controls”. We’re going to create them all in a single content container and lay them out explicitly in order to reflect our design:

The breadcrumb on the top left we can use SharePoint’s breadcrumb trail and we will embed the newsletter subscription into the page layout because we don’t want this to be explicitly defined into the layout.
Defining Your Content Type
So before we do the HTML work, let’s create a content type (a definition for content fields) that defines each of these fields for our page. Based on the above plan, we need the following fields:
- LargeHeadline
- RightHandBlurb
- LeftLinkList
- LeftColumnTitle
- LeftColumnText
- RightColumnText
In each case, these will be HTML controls. SharePoint 2013 allows you to define other types of content for these fields such as images. Images in SharePoint 2013 can be rendered in specific dimensions and SharePoint 2013 will dynamic render any image to that specified to ensure they fit nicely into your defined layout.
To create a content type, go to Site Settings –> Site Content Types (under Web Designer Galleries). If you look at Page Layout Content Types you will see existing ones for Article, Catalog, Welcome Page, etc. We’re going to create a content type for our layout. Click on Create and type in a name for your new content type:
Under Parent Content Type, you can select the parent your content type will inherit from. If you look at the existing page layout content types, they inherit from the content type Page. Page is in the group Publishing Content Types. You can also specify the group you want to place your new content type – you could add it to the existing Page Layout Content Types group or create your own custom group.

When you have created your new content type, SharePoint 2013 will display the columns that were inherited automatically from the Page content type. Lets add some new ones to represent our custom fields. Click on the Add from new site column and let’s add each field:

For each column, we can specify the type. For those fields we want to explicitly style, we can use the Single Line of Text option to have the content author put in plain text that will be formatted by the template. For those fields that we want to provide more control to the content author, we can specify the field as Full HTML content and then content author will be able to put in any HTML using the rich text editor. For our fields, let’s use this approach:
- LargeHeadline – Single line of text
- RightHandBlurb – Multiple lines of text
- LeftLinkList – Full HTML
- LeftColumnTitle – Single line of text
- LeftColumnText – Full HTML
- RightColumnText – Full HTML

For each field, create a site column.
Now we have fields to store the content, let’s now create a Page Layout.
Creating a Page Layout
To create a page layout, go to the Design Manager and Click on 6. Edit Page Layouts. Click on Create a Page Layout. Give your page layout a name, pick your master page and your content type you just created.

If you preview your page layout, you will see it doesn’t look like much – we need to update the HTML around the field controls to properly format the layout.
Publishing Your Page Layout
Before you can use your page layout, it has to be published. To publish your page layout, go to Site Settings –> Master pages and page layouts. You will see two files – one is HTML and one is ASPX. in SharePoint 2013, the HTML is now the master and you can edit it using an HTML editor. SharePoint 2013 then generates the ASPX file automatically. To publish your layout, click on the HTML file and then Publish:

This will publish both the HTML and ASPX files, now making them available to create a page based on your layout.
Creating a Page
To create a page based on our new layout, go to New Page.

If you then go to Page –> Page Layouts you will find our new Page Layout in the list of available Page Layouts. When you switch the page layout, you should now see all the fields that we created earlier in our content type.
You can fill in your content either by typing it in or copying and pasting it from either your existing web site or from office documents such as Word. The copy and paste has improved dramatically over previous versions!
Here is my content now filled out:

Now we can publish our page…

Our content is there, but the layout doesn’t reflect what we want…so now edit the HTML to update our layout.
Customizing Page Layouts
Page layouts in SharePoint 2013 are just HTML files with a lot of additional markup to specify where the controls are going to be injected. We can now customize the HTML file through the design manager. You can simply grab a copy of the HTML file, make your changes and re-upload your file and SharePoint 2013 will do the rest. There are two ways to grab the file:
- Go to Design Manager –> 3. Upload Design Files and map a network drive to your master page directory.
- Go to Site Settings –> Master pages and page layouts and you can download your file.
After iterating a few times with the page layout and moving the snippets provided by SharePoint 2013 into the appropriate spots, we now have a nicely formatted page:

All the content within the main page area is fully managed by SharePoint can be easily changed by a content author.

PS,
refer to:http://blog.navantis.com/create-a-custom-page-layout-in-sharepoint-2013/
Creating a Custom Page Layout in SharePoint 2013的更多相关文章
- 转载 SharePoint 2013配置Master Page and Page Layout
转载原地址: http://www.cnblogs.com/huangjianwu/p/4539706.html 涉及到的内容是关于SharePoint 2013如何部署自定义的母版页和布局页. 进入 ...
- SharePoint 2013 Deploy Master Page And Page Layout
2013年9月27日的一篇随笔,其实也是自己编写的部署文档,由于客户是HK的,所以描述部分是用英文. 涉及到的内容是关于SharePoint 2013如何部署自定义的母版页和布局页. First, L ...
- Creating a New Master Page in SharePoint 2013
Creating a New Master Page in SharePoint 2013 This article explains how to create a Master Page in S ...
- Creating Custom Connector Sending Claims with SharePoint 2013
from:http://blogs.msdn.com/b/security_trimming_in_sharepoint_2013/archive/2012/10/29/creating-custom ...
- Adding a WebPart to a SharePoint 2013 Master Page 分类: Sharepoint 2015-07-08 01:03 7人阅读 评论(0) 收藏
On SharePoint 2013 you can not add the Web Parts to the master page the same way of 2010. Please use ...
- SharePoint 2013 中使用 JavaScript Like 和Unlike list item/page/document
SharePoint 2013中新增了很多社交功能,比如用户可以like/unlike 任何一个 list item/page/document,这是一个非常不错的功能. 但有时觉得like/unli ...
- [转]Creating a custom ribbon for Outlook 2013, 2010 and toolbar for Outlook 2007, 2003 – C# sample
本文转自:https://www.add-in-express.com/creating-addins-blog/2013/05/21/outlook-ui-customization-ribbons ...
- GHOST CMS - 创建自定义主页 Creating a custom home page
创建自定义主页 Creating a custom home page 为你的网站创建一个自定义的主页是一个让你从人群中脱颖而出的好方法,并把你自己独特的印记存放在你的网上.本教程向您展示了如何在Gh ...
- Customize the SharePoint 2013 search experience with a Content Enrichment web service
Did you ever wish you had more control over how your content is indexed and presented as search resu ...
随机推荐
- 2. Add Two Numbers[M]两数相加
题目 You are given two non-empty linked lists representing two non-negative integers. The digits are s ...
- ABBYY迎国庆·庆中秋限时折扣狂潮,再来一波
继ABBYY 早秋限时活动之后,ABBYY官方为迎国庆,庆中秋,折扣狂潮,又来一波.上次活动由于时间短,任务急,数量少,使得不少小伙伴抱憾而止,选择默默等待良机.现在,良机来了,即便没有上次的打折力度 ...
- git diff patch方法
UNIX世界的软件开发大多都是协作式的,因此,Patch(补丁)是一个相当重要的东西,因为几乎所有的大型UNIX项目的普通贡献者,都是通过 Patch来提交代码的.作为最重要的开源项目之一,Linux ...
- [CodeForces]1006F Xor Path
双向搜索. 水div3的时候最后一道题由于C题死活看不懂题 来不及做F了Orz.. 因为n,m是20,双向搜索一下,求个到中间的Xor值的方案,统计一下即可. 时间复杂度\(O(2^{21})\) 好 ...
- nfs+inotify
服务器先安装nfs服务,因为nfs服务端没有固定端口给客户端访问,所以需要借助rpc服务的111端口给客户端连接,即客户端访问rpc会调用nfs服务 yum -y install rpcbind nf ...
- linux--rbtree 解惑 insert
rbtree.txt 中insert 操作,为何用2级指针?? 2级指针用的还是不熟.心虚. Inserting data in the tree involves first searching f ...
- oc基础知识
只在@interface中定义变量的话,你所定义的变量只能在当前的类中访问,在其他类中是访问不了的:而用@property声明的变量可以在外部访问. 用了@property去声明的变量,可以使用“se ...
- Python破解Wifi密码思路
一.前言说明 本机运行环境:系统环境Win10,运行环境Python3.6,运行工具Pycharm 需要Python的包有:pywifi 这是一种暴力破解wifi的模式,需要的时间比较长,本文主要提供 ...
- IBASE4J开发环境搭建
1.修改STS默认编码,Window > Perference > General > Workspace,将 text file encoding 设置为 UTF-8 2.打开 G ...
- vim 跳转指定行
在编辑模式下输入 ngg 或者 nG n为指定的行数(如25) 25gg或者25G 跳转到第25行. 在命令模式下输入行号n : n 如果想打开文件即跳转 vim +n FileName 查看当然光标 ...