Modifying the Page Layout for Enterprise Wiki Pages in SharePoint 2010
In this post, I will show how to modify the page layout for Wiki pages in SharePoint 2010.
There are many reasons you might want to edit the page layout for a Wiki page. For instance, you might want to move the Modified By and Last Modified Date fields to appear below the content. You might create a new content type based on the Wiki Page content type that adds a new field (such as a managed metadata field), or you might want to add additional functionality to the page via code behind.
It’s helpful to understand that pages in an Enterprise Wiki site use the same concepts as publishing pages. That is, there is a content type that defines what columns are available, and a page layout that positions those fields on the page. Here is the page at render time, we see the Last Modified Date and Modified By fields at the top of each page.
The page layout defines the fields that are used when editing the page and what the page looks like in edit mode versus render mode. Here, we can see the field controls change based on them being in edit mode. Notice the Last Modified Date and Modified By fields are read-only. We want to move those to the bottom of the page.
We could customize the out of box Wiki page layout (EnterpriseWiki.aspx), but it’s a better idea to create a new page layout and copy the contents. To create a custom layout, open the site in SharePoint Designer, go to the Page Layouts menu, and choose New Page Layout based on the Enterprise Wiki Page content type.
I highlighted the EnterpriseWiki.aspx out of box file. You can open that file, copy its contents, paste into your new CustomEnterpriseWiki.aspx page, then make your edits. Here, I moved the Modified By and Last Modified Date information to appear below the Wiki text.
Save, check in, publish, and approve changes. Go to the site settings, Page Layout and Template Settings, and add the new page layout.
Go back to the site, create a new Wiki page. Notice that existing pages use the old page layout (you can edit the page and choose the page layout), but all new pages by default use the new page layout.
Notice that the Last modified date and modified by fields now appear below the Wiki content.