In SharePoint there is a concept of creating pages using page layout. We can provide a template using page layout that has the look and feel of a page. Each page layout is associated with some content type, and each content type has fields where the page content is stored. And as we design a page layout, we can add field controls using Microsoft Office SharePoint Designer.
Consider a requirement to provide a sample HTML with layout for creating a page, where the number of fields are not fixed. On the page, the user can add images, PowerPoint presentations, links to external sources. Also, the user can add multiple single line and multiline text fields. But there is a limitation on adding HTML controls; on a single page users cannot add multiple Publishing HTML controls.
Now we see the steps to creating a layout with HTML:
- Open SharePoint Site using SharePoint designer.
- On the left menu, select Page Layout Library. Click on New Page Layout.
- A popup will open up. Select Publishing Content Type from the Content Type Group.
- Enter the URL Name and Title.
- In the place holder main section add “PublishingWebControls:RichHtmlField” control. In this add the tag “html” and put the sample HTML that you want as a template.
READ MORE ARTICLES
- Save the page layout.
Now create a page using the above page layout.
- Open Pages library from Site Content.
- On the ribbon, Click on Files-> New document-> Pages.
- Now enter the title, URL Name and select the page layout. Click Create.
- This will create a page in the page’s library with default HTML.
- To view the default HTML, open the page and click on the Edit button from the Ribbon. The default HTML template will be visible on the page. Now, edit the content in a predefined template and save the page. And here you get a new page created from the predefined template.
NEED HELP IN SHAREPOINT? CONTACT US NOW