How to Create Page Layout (in Publishing Site) with Content type using Design Manager in SharePoint Office 365

Sathish Nadarajan
 
Solution Architect
September 10, 2016
 
Rate this article
 
Views
7416

In this article, let us see how to Create Page Layout with Content Types in a Publishing Site using Design Manager in SharePoint Office 365.

1. To have the Demo, I created a Publishing Site.

clip_image002

2. On the Top Right Corner, select the Settings and Click on the Design Manager.

clip_image004

3. Again on the Left Hand side, select the option “Edit Page Layouts”

clip_image006

4. On the Edit Page Layouts Screen, select the “Create a Page Layout”

clip_image008

5. On the Create New Page, enter the details.

clip_image010

6. On the above screen, if you see, there are some content types listed. Let me create my own content type and that will also be listed on the Drop Down.

7. Let us create the content type with the details as shown in the figure.

clip_image012

8. The content type got created with the default site columns from the Article Page and if we want to have some custom site columns, we can add. In this case, I have added a site column “MySiteColumn” for our demo purpose.

9. The content type would be like this.

clip_image014

10. Now, come back to the Design Manager, we will be seeing our Content Type Listed over there.

11. Create the Layout as shown in figure.

clip_image016

12. Now, publish the Created Layout.

clip_image018

13. Now, when we come back to the Pages Library and create a new page. The Created Layout will be available on the List Box.

clip_image020

14. When I edit the page, we can see the new Site column at the bottom. We can reorder this site columns as well.

clip_image022

Though it is very simple, there are many things around this page layout. Let us see one by one in the future articles.

Happy Coding,

Sathish Nadarajan.

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Create design Package using design manager

Santhosh Babu
 
Technology Specialist
January 9, 2014
 
Rate this article
 
Views
14646

In this post I am going to create a design package using design manager

Step 1: Open the site then click design manager link from right top corner "Settings" menu.

clip_image002

Step 2: Once open the design manager click the “Create Design Package” link and type the Design Name. After then click the create button.

clip_image004

 

 

 

Step 3: After click the create button the package automatically create and the WSP file is ready to download.

clip_image006

Step 4: Click the “Click here to download” link. It will open the “Do you want to save” popup for save the WSP file in local path.

clip_image008

Step 5: Open the downloaded folder you will see the DesignManager-1.0.wsp file.

clip_image010

Next Blog I will explain the import design Package from one environment to another environment using design manager.

Happy Coding.

SanthoshBabu ManickaMohan

Category : SharePoint

Author Info

Santhosh Babu
 
Technology Specialist
 
Rate this article
 
Working as a Technology Specialist in SharePoint ~ Cognizant ...read more
 

Import design Package from one environment to another environment using design manager

Santhosh Babu
 
Technology Specialist
 
Rate this article
 
Views
23794

In this post I am going to import design package from one environment to another environment like development server to SIT server. Based on Microsoft recommended “the deployment user must have the Designers permission level in site collection to use Design Manager and import design packages.”

The previous post already I have explained for how to created design manager package WSP file. In this post I have reuse the WSP file for importing the same.

Step 1: Open the site then click design manager link from right top corner "Settings" menu.

clip_image002[4]

Step 2: Once open the design manager click the “Import a complete design package”

clip_image004[4]

 

Step 3: Browse and select the WSP file and click open then click import button. It will take some time.

clip_image006[4]

Step 4: Once import process completed get the following status

“Import of package "DesignManger-1.0.wsp" succeeded.”

Step 5: Again click the design manager and click “Edit master page” link. You will see the “HTMLpage” – Master page is available in the list in Draft status.

clip_image008[4]

Step 6: Select the Master Page and publish a major version.

clip_image010[4]

Step 7: After publishing the page click setting menu and select “Site setting” link

clip_image012[4]

 

Step 9:

 

Click Master Page link and select the HTMLPage in site master page category drop down menu then click ok button.

 

clip_image014[4]

 

clip_image016[4]

 

Step 10:

Click the home page the Htmlpage converted to SharePoint Master Page with default menu.

clip_image018[4]

Happy Coding.

SanthoshBabu ManickaMohan

Category : SharePoint

Author Info

Santhosh Babu
 
Technology Specialist
 
Rate this article
 
Working as a Technology Specialist in SharePoint ~ Cognizant ...read more
 

Add snippets in Page layout using design manager

Santhosh Babu
 
Technology Specialist
January 5, 2014
 
Rate this article
 
Views
29544

In this post I am going to add a Web Part Zone snippet in page layout.

Step 1: Open the site then click design manager link from right top corner "Settings" menu.

clip_image002

Step 2: Click “Edit Page Layouts” link

clip_image004

 

Step 3: Click “SamplePageLayout” .It will open preview page.

clip_image006

 

Step 4: Once open the preview page then click Snippets menu from top right side. It will open “Snippet Gallery” in new tab page.

clip_image008

 

Step 5: Click the Web Part Zone menu item in “DESIGN “tab.

clip_image010

 

 

 

 

Step 6: In this page we can easy to configure component properties. Now, I will change the Web part Zone Title under Misc category. After customization must click the update button then only the changes are reflected in the component snippet.

clip_image012

Step 7: Once click the update button the HTML code automatically generated in the “HTML snippet” box and click “Copy to Clipboard” button.

clip_image014

 

Step 8: Open the mapped network drive then open the page layout HTML file and paste HTML snippet where you want the web part zone to show.

clip_image016

Step 9: We should add the HTML snippet inside of the <asp:ContentPlaceHolder ID="PlaceHolderMain" runat="server">. In my example I am remove all the default div tags (inside of the content place holder) and paste with my HTML Snippet content.

Default content

clip_image018

Replaced Content

 

clip_image020

Step 10: Once complete the activity the save the page and publish the page layout in design manager.

clip_image022

Step 11: Open the sample page (which we have used in “SamplePageLayout”) and click edit and try to “Add a Web Part”. You will see the web part zone title in the “Add part to” drop down.

clip_image024

clip_image026

 

Next Blog I will explain the create design manager master page package.

Happy Coding.

SanthoshBabu ManickaMohan

Author Info

Santhosh Babu
 
Technology Specialist
 
Rate this article
 
Working as a Technology Specialist in SharePoint ~ Cognizant ...read more
 

How to Create Page layout using design manager

Santhosh Babu
 
Technology Specialist
 
Rate this article
 
Views
16649

In this post I am going to create a page layout using design manager.

Step 1:

Open the site then click design manager link from right top corner "Settings" menu.

clip_image002

Step 2: Click “Edit Page Layouts” link

 

clip_image004

 

 

 

 

 

 

 

Step 3: Click “Create a page layout” link. It will open a popup window and select Master page (which we have created in earlier post) for this scenario we need to select “HTMLPage” then click ok button.

clip_image006

 

Step 4: Once the page layout created then publish the same.

clip_image008

 

 

 

 

Step 5: After publish the page layout click the “Settings” icon then click Add a Page. It will open a popup window and provide the page name and click create button.

clip_image010

clip_image012

 

Step 6: After created page automatically redirect to the new page.

clip_image014

 

Step 7: Select the PAGE tab and open Page Layout menu then select “SamplePageLayout”. It will change the page layout. After then check-in and publish the page.

 

clip_image016

 

 

 

clip_image018

 

Next Blog I will explain about how to add code snippet in page layout.

Happy Coding.

SanthoshBabu ManickaMohan

Author Info

Santhosh Babu
 
Technology Specialist
 
Rate this article
 
Working as a Technology Specialist in SharePoint ~ Cognizant ...read more
 

How to Create Master Page Using Design Manager in SharePoint 2013

Santhosh Babu
 
Technology Specialist
December 30, 2013
 
Rate this article
 
Views
35671

Design Manager is one of the new feature introduced in SharePoint 2013. Using Design Manager, the Branding and Customization can be done very easily in SharePoint 2013. Design Manager only available on publishing site template and the other default templates does not have this feature. Design Manager has a lot of features.  In this post I tried to give a broad idea about Design Manager by converting HTML file to Master page.

Before diving into design manager, First we need to create wireframe in HTML. The wireframe needs to contain HTML, CSS, images and other support files.

I have provided the sample files.

The following is a sample HTML wireframe source and structure.

Structure

clip_image002

Source

1) HTMLPage

 <html>
 <head>
     <title>My Blogs</title>
     <link href="css/profile.css" rel="stylesheet" />
 </head>
 <body>
 
     <div class="page_layout">
         <div class="profilepicture">
 <img class="imgsize" src="images/Profile.JPG" />
         </div>
         <div class="blogtitle">
             Create Master Page using design manager in SharePoint 2013
         </div>
         <div class="pervioustitle">
             <ul class="bloglist">
                 <li>Previous Blog one</li>
                 <li>Previous Blog two</li>
                 <li>Previous Blog three</li>
                 <li>Previous Blog four</li>
             </ul>
         </div>
         <div class="blogcontent">
             sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content sample bolg content                         
             <img src="images/DesignManager.JPG" />
         </div>
     </div>
 
 </body>
 </html>
 

2) CSS

 body {
     font-family: Calibri;
     width: 98%;
 }
 
 div {
     word-wrap: break-word;
 }
 
 .page_layout {
     padding: 10px 0px 0px 0px;
 }
 
 .profilepicture {
     float: left;
     width: 20%;
     height: 200px;
     position: fixed;
 }
 .imgsize {
     width:100%;
     height:100%
 }
 .blogtitle {
     width: 78%;
     float: right;
     font-size: x-large;
     font-weight: bold;
     color: #0000FF;    
     text-decoration:underline;    
 }
 
 .pervioustitle {
     width: 20%;
     padding: 200px 10px 0px 0px;
     float: left;
     position: fixed;
 }
 
 ul.bloglist {
     list-style-type: circle;
     font-size: medium;
     font-weight: bold;
     font-style: italic;
     color: #000066;
 }
 
 .blogcontent {
     float: right;
     width: 78%;
     padding: 20px 5px 0px 5px;
     top: 20px;
 }
 

HTML Page View

 

clip_image004

 

The following is a step by step procedure for creating master page using design manager.

Step 1:

Create new publish portal site collection

clip_image006

Step 2:

Open the site then click design manager link from right top corner "Settings" menu.

clip_image008

Step 3:

Click the upload design files for “Map the following location as a network drive so you can work easily with your design files: “

clip_image010

 

Click the URL and it will provide the network path then map the network drive

clip_image012

If you face the following error.clip_image014

Then add the “Desktop Experience” feature to your server using Server Manager.

 

clip_image016

 

Once the feature activated then maps the network drive.

 

Step 4:

Open the source drive (HTML Wireframe path) and copy all the supported files then paste to destination drive (mapped path).

clip_image018

 

Step 5:

Again open the design manger then click Edit Master Pages and click “Convert HTML file to SharePoint Master Page”

clip_image020

 

Step 6:

It will open a pop up window then select the htmlpage (which you have uploaded) then click insert

clip_image022

Automatically converted from HTML to SharePoint Master Page. The approval status is DRAFT.

 

clip_image024

 

 

 

Step 7:

Once the conversion is completed click the Htmlpage.html check the preview and see the master page then back to the design manager and publish the page.

 

clip_image026

 

 

clip_image028

 

Step 8:

After publishing the page click setting menu and select “Site setting” link

clip_image030

 

Step 9:

 

Click Master Page link and select the HTMLPage in site master page category drop down menu then click ok button.

 

clip_image032

 

clip_image034

 

Step 10:

Click the home page the Htmlpage converted to SharePoint Master Page with default menus.

clip_image036

 

In next article, let us see the code snippet and create design manager master page package.

 

Happy Coding.

SanthoshBabu ManickaMohan

Category : SharePoint

Author Info

Santhosh Babu
 
Technology Specialist
 
Rate this article
 
Working as a Technology Specialist in SharePoint ~ Cognizant ...read more
 

How to Create a Page Layout (PageLayout) with ContentType in SharePoint 2013 using Design Manager – Part III

Sathish Nadarajan
 
Solution Architect
November 16, 2013
 
Rate this article
 
Views
41760

In this article, let us see how to create a PageLayout using Design Manager. In the previous article, we saw about the creating a page layout using Visual Studio, SharePoint Designer. Here let us utilize a new feature in SharePoint 2013, which is not available on SharePoint 2010 – Design manager.

Design Manager is a new feature which is available only in SharePoint 2013 (not in the previous flavors of SP), that allows us to easily create the branding artifacts like MasterPages, CSS, PageLayouts Etc.,

Design Manager will be available only in Publishing template and not in the Developer Site Template. Hence, we need to create a Publishing Site for this demo.

Let me create a publishing Site.

clip_image002

On the Settings Icon on the Right top corner, you can find a new link called Design Manager.

clip_image004

Design Manager will look like this.

clip_image006

Click on the Edit page Layouts link.

clip_image008

Click on the Create Page Layout.

clip_image010

Enter the name for the pagelayout and select the Content Type which we created.

clip_image011

Keep the master page as it is as of now. Since, we are not focusing that.

Now, we got the html file inside the pagelayouts folder.

clip_image013

Let us, publish this. Then the “Approval Status” will become “Approved”

clip_image015

Now, let us go to the Pages document library.

Associate this doc library into our Content Type which we created. To add our Content Type, follow the steps.

clip_image017

Go to Library Settings.

clip_image019

clip_image021clip_image023

That’s it. Now we added our Content Type.

To confirm that, go to the Files-> New Document. Our newly added content type will be listed there.

clip_image025

On the Create Page, you can find the Page Layout, which we created using the Design Manager.

clip_image027

Let me create a page based on the page layout we created.

After giving the mandatory fields, our page will look like the below.

clip_image029

Now, let us see, how to modify the layout of the Page Layout which we created. To see that, go to Master Page Gallery.

clip_image031

You can find the list of files, and the one which we created just now. For every PageLayout, created by the designer would be having 2 files. One aspx and one html. In our case, PageLayoutDesignmanager.aspx and PageLayoutDesignManager.html.

As far as concerning the Design manager approach, html file is very important. The aspx page will be overridden by html template when next time, sharepoint gets loaded. Hence, it is strongly recommended that not to modify the aspx. Modify only the html.

Being a developer/designer, we can use any tool to modify the html. To do that, we need to map the galleries into our local computer.

Open the Windows Explorer and Select Map Network Drive.

clip_image033

Enter the folder as the url of the masterpages gallery.

clip_image035

Now, the folder would be mapped to our local machine.

We can see the files, which we were talking about.

clip_image036

Now, open the html in your favourite editor and modify the layout. Let me open it using the visual studio itself.

The page is a mixture of pure html code and commented aspx

clip_image038

For instance in the html file, remove the following selection that displays the Title field in the Page Title:

clip_image040

As soon as you do it, the modification will be reflected in the associated aspx page:

clip_image042

Now, let’s create a new Page Content from our new JobPosting page and you will see that everything works as expected.

When saved, the page looks like this:

clip_image044

There are no fields labels.

So update the html file with the following spans :

clip_image046

When you make any modification to the html file, don’t forget to Publish a Major version of the file (in the Master Page and Page Layouts gallery).

clip_image048

Now, we are going to redeploy the package.

Go to Design manager and Select Create Design Package.

clip_image050

clip_image052

On clicking the Create,

clip_image054

By clicking the download, we can download our package.

The downloaded will be a WSP and we can open the WSP using visual studio and see, the artifacts. Then we need to copy those files and put in a separate visual studio solution to deliver the package alone.

Happy coding.

Sathish Nadarajan.

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

How to Create a Page Layout (PageLayout) with ContentType in SharePoint 2013 – Part II

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Views
29601

In this article, let us see how to create a PageLayout using SharePoint Designer. In the previous article, we saw about the creating a page layout using Visual Studio. But on that, the PageLayout.aspx, we need to know, how to create the skeleton of the aspx.

We saw that, we need to paste the below lines in the previous post.

 <%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
 
 <%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 
 <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 
 <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 
 <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 
 <asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
 
 <SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
 
 </asp:Content>
 
 <asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
 
 <ui>
 
 <li ><span style="color:red" >Article Author : </span></li><SharePointWebControls:TextField ID="Author" FieldName="5511034a-38c6-4861-9d00-1633cc111ca3" runat="server"></SharePointWebControls:TextField>
 
 <li ><span style="color:red" >Article Body : </span></li><SharePointWebControls:NoteField ID="Body" FieldName="93bb1031-87a2-4f84-bddb-3a9d94d197d1" runat="server"></SharePointWebControls:NoteField>
 
 <li ><span style="color:red" >Tags : </span></li><SharePointWebControls:CheckBoxChoiceField ID="Tags" FieldName="9736f0e4-9c76-4ff7-bf33-1547ac53553c" runat="server"></SharePointWebControls:CheckBoxChoiceField>
 
 </ui>
 
 </asp:Content>
 
 

We should know, how to get this code.

For that, the usual trick is create the layout on the SharePoint Designer and copy the code. Paste it on the Visual Studio aspx page. Build the wsp. That’s it.

For doing that, let us see how to create a page layout using the SharePoint Designer.

Let us open the Designer.

clip_image002

Open our SiteCollection. Here it is SathishPageLayoutSample.

Designer will somewhat looks like this.

clip_image004

Select the Page Layouts

clip_image006

We can see the list of existing PageLayouts.

clip_image008

On that, Click “New Page Layout” from the ribbon

We will be prompted with the following popup.

clip_image010

Select the Content Type and give the URL and Title.

clip_image012

The layout will be created on the PageLayouts folder.

clip_image014

Open the PageLayoutDemoSPD on the Designer itself and modify how you want the layout should be. Later copy the code and paste it on the Visual Studio. That’s it…….

In the next article, let us plan to do the same thing by Design Manager.

Happy Coding.

Sathish Nadarajan.

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

How to Create a Page Layout (PageLayout) with ContentType in SharePoint 2013

Sathish Nadarajan
 
Solution Architect
October 29, 2013
 
Rate this article
 
Views
89566

Creating a PageLayout on a publishing portal is a common requirement through which all of us would have come across. Here let us discuss how to do that on SharePoint 2013 with ContentTypes attached to the PageLayout, using Visual Studio, SharePoint Designer and Design Manager.

Before creating, the PageLayout, we need to create the required site columns and ContentTypes. To do that, let us follow the steps.

1. Open the Visual Studio for a New Empty SharePoint Project.

clip_image002

2. Add separate folders for ContentTypes, Site Columns and PageLayouts. The solution would be like this.

clip_image004

3. Now, add the sitecolumns in the SiteColumns folder.

clip_image006

clip_image008

4. In the same manner, create 2 more site column as Body and Tags. Hence, the 3 site columns will looks like,

 <?xml version="1.0" encoding="utf-8"?>
 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
   <Field
        ID="{5511034a-38c6-4861-9d00-1633cc111ca3}"
        Name="ArticleAuthor"
        DisplayName="ArticleAuthor"
        Type="Text"
        Required="FALSE"
        Group="PageLayoutDemo">
   </Field>
 </Elements>
 
 <?xml version="1.0" encoding="utf-8"?>
 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
   <Field
        ID="{93bb1031-87a2-4f84-bddb-3a9d94d197d1}"
        Name="Body"
        DisplayName="Body"
        Type="Note"
        Required="FALSE"
        RichText="TRUE"
        RichTextMode="FullHtml"
        Group="PageLayoutDemo">
   </Field>
 </Elements>
 
 <?xml version="1.0" encoding="utf-8"?>
 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
   <Field
        ID="{9736f0e4-9c76-4ff7-bf33-1547ac53553c}"
        Name="Tags"
        DisplayName="Tags"
        Type="MultiChoice"
        Required="FALSE"
       Group="PageLayoutDemo">
     <CHOICES>
       <CHOICE>SharePoint 2013</CHOICE>
       <CHOICE>ADFS</CHOICE>
       <CHOICE>SharePoint</CHOICE>
       <CHOICE>PageLayoutSample</CHOICE>
       <CHOICE>Visual Studio</CHOICE>
     </CHOICES>
   </Field>
 </Elements>
 

Here I am referring 3 different data types. You can see the difference on the Type attribute.

5. Now, let us come to the Content Type creation.

clip_image010

clip_image012

On the next screen, choose the page in the drop down and click Finish.

clip_image014

6. Now, the content type got created. We need to add the Site Columns to the Content Type.

clip_image016

7. Now, let us do a deployment and confirm our site columns and Content Types are deployed correctly.

clip_image018

8. Let us see them on the screen.

9. Go to System Settings -> Site Columns (under Web Designer Galleries)

clip_image020

10. In the same manner, go to the Content Types and confirm.

clip_image022

11. Now, let us go back to our Visual Studio and start creating the PageLayout. In the PageLayouts Folder, create a Module.

clip_image024

12. We can see a file called Sample.txt.

clip_image026

13. Rename it into PageLayoutsDemo.aspx

clip_image028

14. Now, on the aspx page, paste the code below.

 <%@ Page language="C#"   Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
 
 <%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
 <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
 <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
 <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 
 <asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
 	<SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
 </asp:Content>
 <asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
 
 <ui>
     
 <li ><span style="color:red" >Article Author : </span></li><SharePointWebControls:TextField ID="Author" FieldName="5511034a-38c6-4861-9d00-1633cc111ca3" runat="server"></SharePointWebControls:TextField>
 <li ><span style="color:red" >Article Body : </span></li><SharePointWebControls:NoteField ID="Body" FieldName="93bb1031-87a2-4f84-bddb-3a9d94d197d1" runat="server"></SharePointWebControls:NoteField>
 <li ><span style="color:red" >Tags : </span></li><SharePointWebControls:CheckBoxChoiceField ID="Tags" FieldName="9736f0e4-9c76-4ff7-bf33-1547ac53553c" runat="server"></SharePointWebControls:CheckBoxChoiceField>
 
 </ui>
 
 </asp:Content>
 

15. We will see, what is the above code snippet and how we got this on the next post.

16. Now, coming to the element.xml file, by default, the aspx file would have created an entry. But apart from that entry, we need to specify some of the properties for that file. These property will make this aspx as a page layout. Otherwise, this aspx will be deployed. But will not be listed on the Pages Layout listbox on the create page.

 
 <?xml version="1.0" encoding="utf-8"?>
 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   <Module Name="PageLayoutDemo" Url="_catalogs/masterpage" List="116" RootWebOnly="TRUE">
     
     <File Path="PageLayoutDemoPageLayoutDemo.aspx" Url="PageLayoutDemo/PageLayoutDemo.aspx" Type="GhostableInLibrary" ReplaceContent="TRUE" Level="Published" >
       <Property Name="Title" Value="Page Layout Demo Title"></Property>
       <Property Name="FileLeafRef" Value="PageLayoutDemo.aspx" />
       <Property Name="MasterPageDescription" Value="Page Layout Demo Description"></Property>
       <Property Name="Page Layout Demo Title" Value="PageLayoutDemo" />
       <Property Name="UIVersion" Value="15" />
       <Property Name="PublishingHidden" Value="FALSE" />
       <Property Name="PublishingAssociatedContentType" Value=";#SathishArticle;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39005FF4CD06D00F41F0A32ADE6126A4F9DE;#"></Property>
      <Property Name="HtmlDesignAssociated" Value="FALSE" />
       <Property Name="ContentType" Value="Page Layout" />
       <Property Name="_ModerationStatus" Value="3" />
       <Property Name="FileDirRef" Value="_catalogs/masterpage" />
       <Property Name="FSObjType" Value="0" />
 
     </File>
   </Module>
 </Elements>
 

17. The important points to be noted here are

 Url="_catalogs/masterpage"
 

– This describes that our file will be deployed under this folder.

 <Property Name="PublishingAssociatedContentType" Value=";#SathishArticle;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39005FF4CD06D00F41F0A32ADE6126A4F9DE;#"></Property>

– Name of the Content type and the ID of the Content Type

18. With this, let us deploy and verify the same.

19. To verify, go to the Pages folder from the Site Contents.

clip_image030

clip_image032

20. After this, we need to add the content type to the Pages List. Then only the content type will be listed under New Document

21. clip_image034

22. To add that, follow the screen shots.

clip_image036

clip_image038

clip_image040

clip_image042

23. Now, if we come back to pages and click the New Document.

clip_image044

Out Content Type will be listed.

24. Click on it to create a new document.

clip_image046

25. Wow… Our PageLayout will be listed on the Listbox. Select that and by giving a title, description, url, click create. In my case, I am giving as Article.

26. Article page will be listed as follows.

clip_image048

27. After that, we need to Check in and Publish the page. Then only this page will be visible to other users. Until then, this will only be visible to the user who created this.

clip_image050

While checkin, it will prompt us to fill the mandatory fields. Since, we gave the ArticleAuthor field as a mandatory one, we need to fill those details.

Let me fill all the three fields, which we gave.

clip_image051

After giving those details, click Save.

Now, the system will allow us to checkin.

clip_image053

After checkin the page will looks like as below.

clip_image054

Here is our Page based on our custom Page Layout is ready.

Thought of explaining the pagelayout.aspx here. But since, it is becoming too lengthy, am planning to describe them on the next article.

Happy Coding.

Sathish Nadarajan.

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Leave a comment