I am creating a custom page layout using SharePoint Designer. I want to add the search box to this page layout in one of my div.
How can I achieve this?
I am creating a custom page layout using SharePoint Designer. I want to add the search box to this page layout in one of my div.
How can I achieve this?
SharePoint 2013
In 2013 you can use design manager for generating web-part zone snippet.
<div>
where class="DefaultContentBlock"
with your own specific content.<!--DC … -->
tag appears.http://msdn.microsoft.com/en-us/library/office/jj862341(v=office.15).aspx
Design Manager generates snippet in following format
<div data-name="WebPartZone">
<!--CS: Start Web Part Zone Snippet-->
<!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
<div xmlns:ie="ie">
<!--MS:<WebPartPages:WebPartZone runat="server" ID="x0e5f5212505f48a9aac43df13eeae4f9" AllowCustomization="True" AllowPersonalization="False" FrameType="TitleBarOnly" LockLayout="True" Orientation="Vertical">-->
<!--MS:<ZoneTemplate>-->
<!--DC: Replace this comment with default web parts for new pages. -->
<!--ME:</ZoneTemplate>-->
<!--ME:</WebPartPages:WebPartZone>-->
</div>
<!--CE: End Web Part Zone Snippet-->
</div>
You can copy this into Page Layout (html) file.
SharePoint 2010
Add the following snippet:
<WebPartPages:WebPartZone runat="server" Title="TestZone1" ID="TestZone1">
<ZoneTemplate></ZoneTemplate>
</WebPartPages:WebPartZone>
It works.